Commit Graph

16147 Commits

Author SHA1 Message Date
Kyle Meyer 4349402f3f Merge branch 'maint' 2020-05-12 22:47:05 -04:00
Kyle Meyer 7684b59c78 colview: Display active time stamps as inactive
* lisp/org-colview.el (org-columns--displayed-value): Convert active
time stamp values to inactive time stamps to avoid duplicate entries
in the agenda.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add
tests.
2020-05-12 22:44:57 -04:00
Stacey Marshall 1228b73313 org-capture: Allow for no file extension on open-source protocol
* lisp/org-capture.el (org-protocol-open-source): Remove requirement
to have :online-suffix and :working-suffix.

The problem here was that two assignments expected suffix's to be
provided in org-protocol-project-alist.  When they were missing an
error occurred.  With the changes source URLs that include the file
name as-is, such as those presented by openGrok, may be opened.

TINYCHANGE
2020-05-12 16:40:26 +02:00
Nicolas Goaziou 88f5ed91c5 `org-startup-folded' defaults to `showeverything'
* lisp/org.el (org-startup-folded): New default value.

See <http://lists.gnu.org/r/emacs-orgmode/2020-04/msg00452.html>.
2020-05-12 12:33:21 +02:00
Nicolas Goaziou 20c1322194 Small fix in `org-cycle-hide-property-drawers'
* lisp/org.el (org-cycle-hide-property-drawers): Ignore case when
looking for the end of a property drawer.
2020-05-10 23:55:12 +02:00
Nicolas Goaziou 7801e92369 Merge branch 'maint' 2020-05-10 14:54:36 +02:00
Yuri D. Lensky 3bbaca1660 ob-latex: Stop ignoring headers argument
lisp/ob-latex.el: During default "png" export, the "headers" argument
is no longer explicitly ignored.
2020-05-10 14:53:11 +02:00
Nicolas Goaziou 20f0299bc3 ox-latex: Do not center images in image links
* lisp/ox-latex.el (org-latex--inline-image): Do not center image when
it is the description of a link.

Reported-by: Arne Babenhauserheide <arne_bab@web.de>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00157.html>
2020-05-10 14:43:40 +02:00
Nicolas Goaziou 6076f40cae Better checks to avoid re-hiding folded drawers
* lisp/org.el (org-hide-drawer-all): Hide regular drawers even in
folded headlines.  They do not use the same invisibility spec.
However, when the heading is folded, still ignore property drawers.
(org-cycle-hide-property-drawers): Only skip property drawers folded
with or inside `outline' overlays.
2020-05-10 11:14:40 +02:00
Nicolas Goaziou eabc9712b7 Fix code typo.
* lisp/org.el (org-cycle-hide-property-drawers): Fix code typo.
2020-05-10 10:46:21 +02:00
Kyle Meyer af3def5d06 Silence recent 'make single' compiler warnings
And remove the org-return-indent declaration in org-keys.el, which is
not needed as of d3e6b5800 (Make RET and C-j obey
`electric-indent-mode', 2020-05-05).
2020-05-09 22:36:00 -04:00
Nicolas Goaziou 1bf2b33e27 Refactor `org-global-cycle'
* lisp/org.el (org-global-cycle): Small refactoring. Always assume
`org-mode' as major mode.  Show all is not necessary.
2020-05-10 02:22:19 +02:00
Nicolas Goaziou a9ba5dc2dc Fix `org-content'
* lisp/org.el (org-content): Use Org function instead of Outline's for
a small speed-up. Properly handle numeric argument.
2020-05-10 02:20:52 +02:00
Nicolas Goaziou f1c0f34772 Small speed-up to `org-overview'
* lisp/org.el (org-overview): Use direct Org function instead of
Outline's for a slight speed-up.
2020-05-10 02:19:43 +02:00
Nicolas Goaziou c744d3cf4c Do not fold drawers hidden inside folded blocks
* lisp/org.el (org-hide-drawer-all):
(org-cycle-hide-property-drawers): Do not fold invisible drawers,
ignoring the type of invisibility spec.
2020-05-09 23:41:39 +02:00
Kyle Meyer b0fb4599c7 Merge branch 'maint' 2020-05-09 15:54:44 -04:00
Matt Lundin 6e50b22ff0 Fix bug that placed cursor incorrectly when setting tags
* lisp/org.el (org-set-tags-command): Only fix cursor position in very
specific circumstances (i.e., when cursor is on an empty headline).
* testing/lisp/test-org.el (test-org/set-tags-command): Add tests
related to point position.

Modified-by: Kyle Meyer <kyle@kyleam.com>
  Adjusted for review comments and added tests.
2020-05-09 15:50:37 -04:00
Nicolas Goaziou e73732f14a compat: Silence byte-compiler
* lisp/org-compat.el (org-cycle-hide-drawers): Ignore optional
argument.
2020-05-09 19:10:47 +02:00
Nicolas Goaziou 92bc33287e Do not fold property drawers in already folded areas
* lisp/org.el (org-cycle-hide-property-drawers): Do not re-fold
drawer.
2020-05-09 19:09:39 +02:00
Nicolas Goaziou 76f5cbd5a5 Properly hide new property drawers
* lisp/org.el (org-insert-property-drawer): Fix typo.
2020-05-09 18:56:34 +02:00
Nicolas Goaziou 3435b05922 Do not move point when cycling subtree visibility
* lisp/org.el (org-cycle-hide-property-drawers): Fix a bug introduced
in 1027e02569.
2020-05-09 18:35:11 +02:00
Kyle Meyer 86ec470bfc Correct :package-version typo from 1027e0256
* lisp/org.el (org-cycle-hook): Fix recent typo in package-version
value.
2020-05-09 11:14:46 -04:00
Nicolas Goaziou 074ea1629c Deprecate `org-cycle-hide-drawers'
* lisp/org.el (org-hide-drawer-all): New function.
(org-cycle-hide-drawers): move...
* lisp/org-compat.el (org-cycle-hide-drawers): ... here.
* lisp/org-agenda.el (org-agenda-show-1): Remove use of
`org-cycle-hide-drawers'.
2020-05-09 15:30:02 +02:00
Nicolas Goaziou 1027e02569 Implement `org-cycle-hide-property-drawers'
* lisp/org.el (org-cycle-hide-property-drawers): New function.
(org-set-startup-visibility):
(org-clean-visibility-after-subtree-move):
(org-sort-entries):
(org-cycle-hook):
(org-show-entry):
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Use new function.
2020-05-09 15:20:39 +02:00
Nicolas Goaziou 8b05c06d42 Use `outline' invisibility spec for property drawers
* lisp/org.el (org--hide-wrapper-toggle): Use `outline' invisibility
spec when hiding a property drawer.
(org-cycle): Fix typo.
2020-05-09 13:30:27 +02:00
Nicolas Goaziou ed0e75d241 Fix typo
* lisp/org.el (org-at-property-drawer-p): Fix typo.
* testing/lisp/test-org.el (test-org/at-property-drawer-p): Update
name and function calls.  Add a test.
2020-05-09 12:58:09 +02:00
Nicolas Goaziou 8580ef6ec1 Rename `org-at-property-block-p'
* lisp/org.el (org-at-property-drawer-p): New name.
* lisp/org-compat.el (org-at-property-block-p): Obsolete alias.
2020-05-09 12:50:34 +02:00
Nicolas Goaziou 7e7f5c6f03 Rewrite `org-at-property-block-p'
* lisp/org.el (org-comment-regexp): New variable.
(org-at-property-block-p): Rewrite function to check syntax locally.
(org-at-comment-p): Use new variable.
2020-05-09 12:47:37 +02:00
Nicolas Goaziou e39365e32f table: Avoid unnecessary consing
* lisp/org-table.el (org-table-align): Avoid unnecessary consing.
2020-05-09 10:44:43 +02:00
Nicolas Goaziou ba7bf12b44 table: Small refactoring of `org-table-align'
* lisp/org-table.el (org-table-align): Remove dead code.  Slightly
simplify code.
2020-05-08 23:40:57 +02:00
Nicolas Goaziou 984c7af21f table: `org-table-to-lisp' preserves text properties.
* lisp/org-table.el (org-table-to-lisp): Preserve text properties.
Otherwise, it breaks `org-table-align', which needs to know about
invisible characters.
2020-05-08 16:14:50 +02:00
Nicolas Goaziou 13195a4a5f table: Speed-up for `org-table-align'
* lisp/org-table.el (org-table-align): Use `org-table-to-lisp'.

Suggested-by: Thierry Banel <tbanelwebmin@free.fr>
2020-05-08 15:42:43 +02:00
Kyle Meyer cd61eedddb Merge branch 'maint' 2020-05-07 22:47:35 -04:00
Kyle Meyer ff56f580da capture: Correct docstring typo
* lisp/org-capture.el (org-capture--position-cursor): Correct
docstring typo.
2020-05-07 22:47:20 -04:00
Nicolas Goaziou 0edd9aee38 Merge branch 'maint' 2020-05-07 22:37:02 +02:00
Nicolas Goaziou 09086b7e75 Fix capturing plain text with :unnarrowed property and no "%?" marker
* lisp/org-capture.el (org-capture-narrow): Remove undocumented point
move.
(org-capture--position-cursor): New function.
(org-capture-place-entry):
(org-capture-place-item):
(org-capture-place-table-line):
(org-capture-place-plain-text): Use new function.
* testing/lisp/test-org-capture.el (test-org-capture/plain): Add test.

Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00095.html>
2020-05-07 22:35:13 +02:00
Kévin Le Gouguec e47b053d9a compat: Add `org-newline-and-indent'
* lisp/org-compat.el (org-newline-and-indent): New function.
* lisp/org.el (org--newline): Use new function.
2020-05-07 21:34:32 +02:00
Nicolas Goaziou e304d58978 Revert "Fix docstring"
This reverts commit 5d308e2728.
2020-05-07 21:29:46 +02:00
Nicolas Goaziou 5d308e2728 Fix docstring
* lisp/org.el (org--newline): Fix docstring.
2020-05-07 14:10:05 +02:00
Kévin Le Gouguec d3e6b58004 Make RET and C-j obey `electric-indent-mode'
* lisp/org-compat.el (org-return-indent): Deprecate this command.
* lisp/org-keys.el (org-mode-map): Rebind C-j to a command emulating
`electric-newline-and-maybe-indent'.
* lisp/org.el (org-cdlatex-environment-indent): Stop using the now
obsolete function.
(org--newline): New helper function.
(org-return): Use it to transparently handle `electric-indent-mode'.
(org-return-and-maybe-indent): New command to emulate
`electric-newline-and-maybe-indent' while taking care of Org special
cases (tables, links, timestamps).
* testing/lisp/test-org.el (test-org/with-electric-indent,
test-org/without-electric-indent): New tests.
* testing/org-test.el (org-test-with-minor-mode): New helper to set a
minor mode to a specific state, and reset it afterward.
2020-05-07 12:14:30 +02:00
Kyle Meyer b171ff02f6 Merge branch 'maint' 2020-05-05 22:38:00 -04:00
Kyle Meyer f4fed7ea0c org: Retain prefix arg when dispatching dynamic block commands
* lisp/org.el (org-dynamic-block-insert-dblock): Add an interactive-p
argument that is non-nil for interactive calls and signals to call the
dynamic block function interactively.

org-clock-report takes a prefix argument.  When it had a regular
binding, this was easy to access.  As of 34b71a0ca (Add a dispatcher
command for inserting dynamic blocks, 2018-12-23), its only "binding"
is through the dynamic block dispatcher.  Make it possible to supply a
prefix argument in that context too.
2020-05-05 22:31:43 -04:00
Kyle Meyer 8368c38e01 Autoload dynamic block definitions
* lisp/org-clock.el:
* lisp/org-colview.el: Autoload call to org-dynamic-block-define.

The dynamic block dispatcher added in 34b71a0ca (Add a dispatcher
command for inserting dynamic blocks, 2018-12-23) offers an entry for
"clocktable" and "columnview" only after the corresponding library is
loaded.  However, before that commit, the autoloaded org-clock-report
and org-columns-insert-dblock commands were accessible via plain key
bindings.  Restore the ability to access these commands before the
associated library is loaded.

Reported-by: Axel Kielhorn <org-mode@axelkielhorn.de>
<3CE37EF0-6C7A-4CC0-AFEE-2B82296D63E1@axelkielhorn.de>
2020-05-05 22:31:43 -04:00
Nicolas Goaziou ea6a9bd6fa Add menu entry for `org-insert-structure-template'
* lisp/org.el (org-org-menu): Add entry.

Reported-by: John Ciolfi <ciolfi@mathworks.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-11/msg00157.html>
2020-05-06 02:47:35 +02:00
Nicolas Goaziou 271f5a6829 Insert planning in visible part of narrowed buffer
* lisp/org.el (org-add-planning-info): Make sure planning info appears
in the visible part of a narrowed buffer.
* testing/lisp/test-org.el (test-org/deadline):
(test-org/schedule): Update tests.

Reported-by: Michaël Cadilhac <michael@cadilhac.name>
<http://lists.gnu.org/r/emacs-orgmode/2019-09/msg00091.html>
2020-05-06 02:43:42 +02:00
Nicolas Goaziou 046f1d22ff org-ellipsis cannot be local variable
* lisp/org.el (org-ellipsis): docstring specifies it cannot be a local
variable.  As a consequence, remove :safe keyword.

Reported-by: "Mark E. Shoulson" <mark@shoulson.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-01/msg00145.html>
2020-05-06 02:15:22 +02:00
Nicolas Goaziou 7d35d46494 Fix :package-version values
* lisp/ol.el (org-link-email-description-format):
* lisp/org-src.el (org-src-tab-acts-natively):
* lisp/org-table.el (org-table-header-line-p):
* lisp/org.el (org-loop-over-headlines-in-active-region):
(org-fontify-done-headline): Use correct (PACKAGE . VERSION-STRING)
value.  Remove :version keyword since :package-version overrides it.
2020-05-06 02:12:23 +02:00
Kyle Meyer 89b0d485b1 Merge branch 'maint' 2020-05-05 00:16:53 -04:00
Eric Timmons 0f783cbca8 ox-odt: Do not ignore org-odt-styles-file
* lisp/ox-odt.el (odt): Delete a repeated entry for :odt-styles-file
and absorb its org-odt-styles-file, which had no effect due to the
repeated entries, into the first definition.

TINYCHANGE
2020-05-05 00:15:57 -04:00
Roland Coeurjoly 6fd05fcaca ob-haskell: Print all results with :results output
* lisp/ob-haskell.el (org-babel-execute:haskell): Print all results,
including the last one.
2020-05-04 16:57:49 +02:00
Nicolas Goaziou e5eda0beeb table: Tiny clean-up
* lisp/org-table.el (org-table-export): Remove unnecessary calls to
`buffer-substring-no-properties'.
2020-05-02 11:32:17 +02:00
akater d23bd91874 org-agenda.el: Complete multiple todo keywords
* lisp/org-agenda.el (org-todo-list): Use completing-read-multiple
  instead of completing-read when selecting todo keywords to filter by
  in Agenda.  Fix a typo in the prompt.

TINYCHANGE
2020-05-01 23:32:29 -04:00
Marco Wahl 90185c98f4 table: Remove the last row (LR) feature
The feature was undocumented and broken according to Carsten.

* lisp/org-table.el (org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-get-formula):
(org-table-fix-formulas):
(org-table-analyze): Remove the parts refering to LR.
2020-05-02 00:04:30 +02:00
Nicolas Goaziou 609e4f004b list: Refactor `mapc' + `lambda' into `dolist'
* lisp/org-list.el (org-list-get-subtree):
(org-list-struct-fix-box):
(org-list-struct-fix-item-end):
(org-apply-on-list):
(org-list-set-item-visibility):
(org-toggle-checkbox):
(org-list-indent-item-generic): Use `dolist', or `pcase-dolist'
instead of `mapc' + `lambda'.
2020-05-01 15:51:43 +02:00
Nicolas Goaziou ce10179cc2 table: `org-table-to-lisp' does not check if point is at a table
* lisp/org-table.el (org-table-to-lisp): Do not check if point is at
a table.  Leave it to the caller.

See <http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00000.html>.
2020-05-01 15:00:47 +02:00
Nicolas Goaziou e955976983 table: Small fix
* lisp/org-table.el (org-table-to-lisp): Make sure to stop at the end
of the table.
2020-05-01 12:29:11 +02:00
tbanelwebmin 20f2cd8416 table: Rewrite `org-table-to-lisp'
* lisp/org-table.el (org-table-to-lisp): Rewrite function.

The new implementation can be more than 100 times faster.  This enhances
responsiveness of Babel or Gnuplot blocks handling very large tables.
2020-05-01 00:26:46 +02:00
Nicolas Goaziou 1e1328b41c Move some functions in "org-macs.el"
* lisp/org.el (org--line-empty-p):
(org-previous-line-empty-p):
(org-next-line-empty-p): Move these functions...
* lisp/org-macs.el: ... here.
2020-04-30 11:23:11 +02:00
Nicolas Goaziou e68ae40bdb babel: Remove unneeded declare function 2020-04-28 09:51:20 +02:00
Nicolas Goaziou c672651fef Small speed-up for `org-collect-keywords'
* lisp/org.el (org--collect-keywords-1): Do not really activate Org
mode in setup files.
2020-04-28 09:50:46 +02:00
Nicolas Goaziou 80865bab64 Improve SETUPFILE error handling
* lisp/org.el (org-file-contents): Return nil when NOERROR is non-nil
and an error is raised.
(org--collect-keywords-1): Do not raise an error when an invalid
SETUPFILE keyword is met.
2020-04-27 23:31:05 +02:00
Nicolas Goaziou 912c696cd9 ox: Fix b4e91b7e94
* lisp/ox.el (org-export--get-inbuffer-options): Add missing PLIST.
2020-04-27 10:39:05 +02:00
Nicolas Goaziou 31068373dc export: Remove `org-export-special-keywords'
* lisp/ox.el (org-export-special-keywords):
(org-export--get-inbuffer-options): Do not use `org-export-special-keywords'.
2020-04-26 22:59:24 +02:00
Nicolas Goaziou 3e44ddbe78 macro: Small refactoring.
* lisp/org-macro.el (org-macro--collect-macros): Use
`org-collect-keywords'.
2020-04-26 22:57:47 +02:00
Nicolas Goaziou 0826461bc1 ox: Small refactoring
* lisp/ox.el (org-export--list-bound-variables): Use
`org-collect-keywords'.
2020-04-26 22:42:26 +02:00
Nicolas Goaziou b223a28063 Fix last commit
* lisp/org.el (org--collect-keywords-1): Fix thinko.
2020-04-26 18:51:16 +02:00
Nicolas Goaziou 053676d284 Better handling of filenames in `org-collect-keywords'
* lisp/org.el (org-collect-keywords):
(org--collect-keywords-1): Add a new argument to take into
consideration current directory.
2020-04-26 18:40:24 +02:00
Nicolas Goaziou b4e91b7e94 New function: org-collect-keywords
* lisp/org.el (org-set-regexps-and-options): Use new function.
(org-collect-keywords):
(org--collect-keywords-1): New functions.
* lisp/ox.el (org-export--get-inbuffer-options): Use new function.
2020-04-26 18:06:15 +02:00
Nicolas Goaziou 3c4cb7b296 Merge branch 'maint' 2020-04-26 10:37:28 +02:00
Nicolas Goaziou f3c137a697 ol: Fix info links with backquotes and backslashes
* lisp/ol.el (org-store-link): Remove spurious backslash appearing in
some Info buffers.

Reported-by: Achilles Yuce <ayuce@posteo.mx>
<http://lists.gnu.org/r/emacs-orgmode/2020-04/msg00405.html>
2020-04-26 10:36:39 +02:00
Kyle Meyer 3c31941139 Fix loading issues related to org-refile.el move
* lisp/org-refile.el (org-directory):
(org-default-notes-file):
(org-reverse-note-order):
(org-outline-path-cache):
(org--get-outline-path-1):
(org-get-outline-path):
(org-format-outline-path):
(org-display-outline-path): Move back to org.el.
* lisp/org-id.el: Require org-refile.
* lisp/org-refile.el: Require org.

f636cf91b (New org-refile.el file with refile definitions, 2020-02-05)
moved refile-related code into a new file, org-refile.el.  This
introduced several dependency issues, which can be seen by running
`make single'.

Many of these issues could be solved by loading org.el in
org-refile.el and loading org-refile in several libraries that depend
on moved functionality.  However, there would still be a circular
dependency because org.el depends on three variables now defined in
org-refile.el.  Also, conceptually there is the problem that the
outline path functionality, despite being used primarily for refile
internally, is now used more generally in third-party code and in a
couple of spots within this repo.

Resolve the above situation by moving the three org-refile.el
variables that org.el needs and the outline path bits back to org.el.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<CAFyQvY1VR5t_a=JO01+QWbUQk_9i8+2XG6W2-mg-DpFzjz9seg@mail.gmail.com>

Reported-by: Ihor Radchenko <yantar92@gmail.com>
<878sj74lfp.fsf@localhost>

Reported-by: Ryan C. Thompson <rct@thompsonclan.org>
<8861c9e9-6c19-ea8f-6a90-7a466782096f@thompsonclan.org>
2020-04-26 01:29:33 -04:00
Nicolas Goaziou 14d6f95bec element: Tiny refactoring
* lisp/org-element.el (org-element-object-restrictions): Use
`minimal-set' to express the common denominator between restrictions.
2020-04-25 15:58:33 +02:00
Nicolas Goaziou b3a59c858d org-element: Tiny speed-up for empty statistics cookies
* lisp/org-element.el (org-element--object-lex): Branch earlier for
empty statistics cookies.
2020-04-25 14:43:51 +02:00
Nicolas Goaziou 94c2ef7d09 element: Small speed-up in object parsing
* lisp/org-element.el (org-element--object-lex): Branch earlier for
footnote references.
2020-04-25 14:40:23 +02:00
Nicolas Goaziou 12515da332 Fix LaTeX fragments fontification
* lisp/org.el (org-do-latex-and-related): Limit false positive, e.g.,
in ORG-NEWS file.  Small speedup.
2020-04-24 00:52:14 +02:00
Nicolas Goaziou 4a27b67fd2 org-element: Fix property drawers parsing
* lisp/org-element.el (org-element--next-mode): Properly handle first section.
* lisp/org-lint.el (org-lint-obsolete-properties-drawer): Ignore
document-level property drawers.
* testing/lisp/test-org-lint.el (test-org-lint/obsolete-properties-drawer):
Add tests.
2020-04-22 16:06:43 +02:00
Brian Powell bc90264ac6 ox-html: Add customizable format string for equations
* lisp/ox-html.el (org-html-equation-reference-format): New variable.
* doc/org-manual.org update to reference new variable
2020-04-21 19:44:03 +02:00
Nicolas Goaziou 5afacc5fce Do not apply drawer face also on indentation
* lisp/org.el (org-fontify-drawers): Do not apply drawer face also on
indentation.

Reported-by: Norman Tovey-Walsh <ndw@nwalsh.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-04/msg00330.html>
2020-04-21 18:42:43 +02:00
Claudiu ba7d20fcc3 ox: add Romanian translation
* lisp/ox.el (org-export-dictionary): Add Romanian translation.

TINYCHANGE
2020-04-21 18:36:19 +02:00
Kyle Meyer bab2995c71 Merge branch 'maint' 2020-04-20 20:47:24 -04:00
Leo Vivier 41fe010868 Fix docstring typo
* lisp/org.el (org-mode-map): Fix typo.

TINYCHANGE
2020-04-20 20:47:09 -04:00
Kyle Meyer c716b7c085 org-id: Allow file name to be overridden on ID creation
* lisp/org-id.el (org-id-overriding-file-name): New variable.
(org-id-get): Prefer org-id-overriding-file-name over the buffer's
file name if set.
(org-id-locations-load): Give a more informative error when file is
nil.
* lisp/org.el (org-clone-subtree-with-time-shift): Let-bind
org-id-overriding-file-name, enabling an ID to be created for a cloned
subtree rather than crashing with a type error.

Note that, before 9865e6bd8 (org-id: Speedup, minor functional change
and fix, 2019-08-01), this wouldn't fail with a type error.  However,
the ID would not be added correctly because org-id-add-location simply
wouldn't process the ID at all if the passed file was nil.

Reported-by: Ian Eure <ian@retrospec.tv>
<87a73caayj.fsf@phaktory>
2020-04-20 20:46:56 -04:00
Mattias Engdegård e69937ddac Backport commit 6a60701bb from Emacs
* lisp/org-table.el (org-table-finish-edit-field):
Further improvement of regexp, as suggested by Paul Eggert.

Improve regexp in org-table-finish-edit-field
6a60701bba3d87f5d9a1730e18b6da827f41a062
Mattias Engdegård
Thu Apr 16 19:53:10 2020 +0200
2020-04-20 00:42:44 -04:00
Mattias Engdegård 989a51105c Backport commit d5a7df8c0 from Emacs
* lisp/ob-core.el (org-babel-remove-temporary-directory): Use
directory-files-no-dot-files-regexp.

Use directory-files-no-dot-files-regexp wherever possible
d5a7df8c02f04102d50a5cd2290262f59f2b1415
Mattias Engdegård
Thu Apr 16 12:14:38 2020 +0200
2020-04-20 00:42:44 -04:00
Mattias Engdegård 37c916d90c Backport commit 905c0a13f from Emacs
* lisp/org-table.el (org-table-finish-edit-field):
Avoid wrapped subsumption in repeated sequences.

Fix bugs, inefficiencies and bad style in regexps
905c0a13f7929298cb36151f46dbef03f7bdcbe4
Mattias Engdegård
Thu Apr 16 12:14:38 2020 +0200
2020-04-20 00:42:44 -04:00
Kyle Meyer b359de549e Merge branch 'maint' 2020-04-20 00:42:38 -04:00
Mattias Engdegård bf99b6dc11 Backport commit 4acdd7fe5 from Emacs
* lisp/ob-core.el (org-babel-remove-temporary-directory):
Use (rx (or (not ".") "...")), translated into "[^.]\\|\\.\\.\\.", to
match anything but "." and "..".

Fix edge case errors in filename-matching regexps
4acdd7fe58ae9f94102afeca67b0383141d597da
Mattias Engdegård
Tue Apr 14 12:25:16 2020 +0200

Note(km): Replaced bare "." with (any ".") for Emacs < 27
compatibility.  4acdd7fe5 was on the emacs-27 branch, but a commit on
their master (d5a7df8c0) will supersede this.
2020-04-20 00:41:39 -04:00
Nicolas Goaziou 0d1d56f86a Merge branch 'maint' 2020-04-19 00:04:27 +02:00
Nicolas Goaziou eb2d6a8cd4 Fix some fontification issues
* lisp/org.el (org-inside-LaTeX-fragment-p): properly find limit.

This commit partly reverts ad8e508e93.
2020-04-19 00:02:53 +02:00
Nicolas Goaziou 62f197103f compat: Silence byte-compiler
* lisp/org-compat.el (org-hide-block-toggle-maybe): Tiny refactoring.
2020-04-18 19:37:41 +02:00
Nicolas Goaziou 43956c693b Small refactoring to `org-cycle'
* lisp/org.el (org-cycle): Integrate new folding functions for
drawers.  Small refactoring, in particular to minimize the number of
calls to `org-element-at-point'.
2020-04-18 18:34:56 +02:00
Nicolas Goaziou 692f191f84 Refactor block and drawer visibility toggling
* lisp/org.el (org--hide-wrapper-toggle): New function.
(org-hide-block-toggle):
(org-hide-drawer-toggle): Use new function.
2020-04-18 18:34:56 +02:00
Nicolas Goaziou 4fbc36a057 Deprecate `org-hide-block-toggle-all'
* lisp/org.el (org-hide-block-toggle-all): move...
* lisp/org-compat.el (org-hide-block-toggle-all): ... here.
2020-04-18 18:34:56 +02:00
Nicolas Goaziou cd9e000d86 Deprecate `org-hide-block-toggle-maybe'
* lisp/org.el (org-hide-block-all): Use `org-hide-block-toggle'.
(org-hide-block-toggle-maybe): move...
* lisp/org-compat.el (org-hide-block-toggle-maybe): ... here.
2020-04-18 18:34:56 +02:00
Nicolas Goaziou 09f1b74f25 Change signature for `org-hide-block-toggle'
* lisp/org.el (org-hide-block-toggle): Add two optional arguments.
Small refactoring.
2020-04-18 18:34:55 +02:00
Nicolas Goaziou b4f77b1f9a Deprecate `org-flag-drawer'
* testing/lisp/test-org.el (test-org/flag-drawer): Remove tests.
* lisp/org-clock.el (org-clock-jump-to-current-clock):
* lisp/org.el (org-cycle-hide-drawers): Use `org-hide-drawer-toggle'
instead.
(org-insert-drawer)
(org-hide-drawer-toggle): Use `org-flag-region' instead.
(org-flag-drawer): move...
* lisp/org-compat.el (org-flag-drawer): ... here.
2020-04-18 18:34:55 +02:00
Nicolas Goaziou e6cd5a50d1 Drawer visibility tooling mimics blocks'
* lisp/org.el (org-hide-drawer-toggle): New function.
(org-flag-drawer): Assume either a parser drawer or buffer positions
are provided.  Remove unnecessary checks, since this is a low-level function.
* testing/lisp/test-org.el (test-org/hide-drawer-toggle): New test.
(test-org/flag-drawer):
(test-org/show-set-visibility): Update tests.
2020-04-18 18:34:55 +02:00
Nicolas Goaziou e515a7cec8 Merge branch 'maint' 2020-04-18 18:34:24 +02:00
Nicolas Goaziou 756ddff9e3 table: Small fix to column deletion
* lisp/org-table.el (org-table-delete-column): Do not assume row ends
right after the last vertical line.  Do not use `looking-back'.
* testing/lisp/test-org-table.el (test-org-table/delete-column): Add
test.
2020-04-18 18:33:07 +02:00
Nicolas Goaziou 65a7267b37 Merge branch 'maint' 2020-04-18 18:23:12 +02:00
Nicolas Goaziou c7063b05f7 publish: Fix site-map file name
* lisp/ox-publish.el (org-publish-sitemap): Use `expand-file-name' to
build site-map file name.

Reported-by: juanjose.garcia.ripoll@csic.es (Juan José García Ripoll)
<http://lists.gnu.org/r/emacs-orgmode/2020-04/msg00280.html>
2020-04-18 18:22:28 +02:00
Marco Wahl 6f38fe24a3 Merge branch 'maint' 2020-04-18 16:17:12 +02:00
Marco Wahl bb9dfdafeb org-table: Make column delete consistent with row delete
* lisp/org-table.el (org-table-delete-column): Stay in the column at
delete.  Exceptionally allow column delete when point is at eol
immediately to the right of a cell seperator.

A hint by Eric S Fraga led to this commit.
https://lists.gnu.org/archive/html/emacs-orgmode/2020-04/msg00283.html
2020-04-18 16:16:02 +02:00
Marco Wahl c990d43a64 org-table: Small refactoring
* lisp/org-table.el (org-table-fix-formulas): Eliminate a local
variable.
2020-04-18 01:20:49 +02:00
Marco Wahl 5dcf6d4af3 org-table: Decrease the amount of redundant messages
* lisp/org-table.el (org-table-fix-formulas): Only one message per
tblfm instead of an update message for every line.
2020-04-18 01:03:15 +02:00
Marco Wahl 0e5be8a656 Merge branch 'maint' 2020-04-18 00:21:39 +02:00
Marco Wahl 22d2b0ac84 org-table: Insert column at point
* lisp/org-table.el (org-table-insert-column): Adjust the function to
insert the column at point (and not to the right.)

Org-manual, ORG-NEWS and testing are changed accordingly.
2020-04-18 00:13:24 +02:00
Kyle Meyer 9994e8ee89 org.el: Silence some byte-compiler warnings
The remaining ones are related to the org-refile.el movement in
f636cf91b (New org-refile.el file with refile definitions,
2020-02-05).
2020-04-15 22:00:51 -04:00
Nicolas Goaziou 0fadd06b72 Fix "Symbol’s function definition is void: case"
* lisp/org-macs.el (org-scroll): Use `cl-case' instead of `case'.
2020-04-14 16:48:27 +02:00
Kyle Meyer 65f5bb6e96 Merge branch 'maint' 2020-04-12 18:27:16 -04:00
Kyle Meyer c77edde765 org-time-stamp-inactive: Remove inaccurate statements
* lisp/org.el (org-time-stamp-inactive): Drop incorrect statements in
docstring about differences between inactive and active timestamps.

S-cursor commands work on inactive time stamp, and clicking on an
inactive time stamp visits the day in the agenda, just as it does for
an active time stamp.

Reported-by: Jorge P. de Morais Neto <jorge@disroot.org>
  <87a73gstpz.fsf@disroot.org>
2020-04-12 18:26:31 -04:00
Kyle Meyer 32d8f2f32e Merge branch 'maint' 2020-04-12 01:44:21 -04:00
Kyle Meyer 1de7eabf25 Revert "org-agenda.el: Fix handling of one-time delays"
* lisp/org-agenda.el (org-agenda-get-scheduled): Revert changes from
39c656870, which introduced a regression that prevents repeating tasks
from appearing for future dates.

The regression, reported in late February, seems likely to affect more
users than the one-time delay handling fixed by 39c656870
(org-agenda.el: Fix handling of one-time delays, 2020-02-01).  As we
don't have a proposed fix at the moment, let's revert 39c656870.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
  <87imjqdtpo.fsf@gmail.com>
2020-04-12 01:43:26 -04:00
Kyle Meyer a5cb52b4f8 org-archive: Correct commentary in file header 2020-04-12 01:43:05 -04:00
Nicolas Goaziou b49aabdba4 Merge branch 'maint' 2020-04-10 16:06:57 +02:00
Nicolas Goaziou 8b988ee3a5 org-list: Another fix to item insertion
* lisp/org-list.el (org-list-insert-item): Fix typos. Add a check to
determine if an item really belongs to the part being split.
* testing/lisp/test-org-list.el (test-org-list/insert-item): Add test.
2020-04-10 16:06:05 +02:00
Nicolas Goaziou d61631bb19 Merge branch 'maint' 2020-04-10 15:11:29 +02:00
Nicolas Goaziou 8eef99306a org-list: Fix last commit
* lisp/org-list.el (org-list-insert-item): This is a followup to
1ae1f8f2df.  It fixes an error when
insertion happens after the last item in the list.
* testing/lisp/test-org-list.el (test-org-list/insert-item): Add test.
2020-04-10 15:09:49 +02:00
Gustav Wikström 8e3b73d4dc Allow storing and following ID links before first heading
* lisp/org.el (org-find-property): Make org-find-property work
  correctly also before first heading.

* lisp/org-id.el (org-id-store-link): Make it possible to store ID
  links also before first heading.
2020-04-10 10:04:12 +02:00
Kyle Meyer 9e385d1bab Merge branch 'maint' 2020-04-09 22:29:48 -04:00
Kyle Meyer 6f1b837492 Silence byte-compiler
These both show up when compiling files separately (e.g., 'make
single').

ob-core already assumes ob-tangle is loaded based on declared
functions, presumably because ob.el is given responsibility for
collectively loading these pieces.  org.el loads org-attach within the
body of a function before calling org-attach-dir.
2020-04-09 22:27:06 -04:00
Nicolas Goaziou 44ec473c19 Small fix
* lisp/org.el (org-set-tags-command): Also avoid using `looking-back',
in particular without a LIMIT argument.  This silences the
byte-compiler.

(cherry picked from commit 83518daf11)
2020-04-09 22:25:30 -04:00
Kyle Meyer 06c7a54f0b org-shift*: Honor org-support-shift-select for table cell movement
* lisp/org.el (org-support-shift-select): Mention table context.
(org-shiftup):
(org-shiftdown):
(org-shiftright):
(org-shiftleft): Don't move table cells when org-support-shift-select
is `always'.

Reported-by: Vladimir Panteleev <thecybershadow@gmail.com>
<CAHhfkvw8O4cSxe5CJXQ8L+ce+9wOhuM==Xv9rB2NVhsCgYANdA@mail.gmail.com>
2020-04-09 22:24:55 -04:00
Nicolas Goaziou a2281ea9fe Merge branch 'maint' 2020-04-09 15:43:58 +02:00
Nicolas Goaziou 1ae1f8f2df org-list: Fix infloop when inserting item in post sub-list area
* lisp/org-list.el (org-list-insert-item): Do not infloop when
insertion happens in an item, after a sub-list.  Small refactoring.
* testing/lisp/test-org-list.el (test-org-list/insert-item): Add
tests.
2020-04-09 15:42:36 +02:00
Kyle Meyer 4fde1ce64a Merge branch 'maint' 2020-04-08 22:57:05 -04:00
Leo Vivier acd1635966 org: Fix docstring typo
* lisp/org.el (org-time-stamp-inactive): Change ‘active’ to ‘inactive’
in the docstring.

TINYCHANGE
2020-04-08 22:55:00 -04:00
Kyle Meyer 5b81f3c2a9 archive: Fix stale comment
* lisp/org-archive.el (org-archive-subtree): Drop stale comment about
killing the archive buffer.

This hasn't been true since 343f3c478 (Keep archive buffer after
archiving something to it, 2009-10-28).
2020-04-07 22:48:06 -04:00
Kyle Meyer 60adefb103 org-archive-subtree-save-file-p: Tweak :tag text
* lisp/org-archive.el (org-archive-subtree-save-file-p): Minor edits
to :tag text.

The main thing change is to avoid saying "always" save the archive
buffer because it's not saved when the current buffer is the archive
buffer.  Also, mention this in the docstring.

Reported-by: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
<87zhcybjz5.fsf@gmail.com>
2020-04-07 22:48:06 -04:00
Nicholas Vollmer 374cb4b415 org-archive.el: Fix org-archive-subtree-save-file-p
* lisp/org-archive.el (org-archive-subtree-save-file-p): Consider case
of `from-org' setting in saving logic, improve docstring, and remove
dead code comment.

Fixes 3d0282ef8 (New option `org-archive-subtree-save-file-p',
2020-01-31).

Modified-by: Kyle Meyer <kyle@kyleam.com>
  Dropped whitespace noise in surrounding code, simplified condition,
  and kept :tag text (to be tweaked in following commit).

TINYCHANGE
2020-04-07 22:48:06 -04:00
Kyle Meyer b2aa7e99f2 Merge branch 'maint' 2020-04-07 22:47:51 -04:00
Kyle Meyer 561e9efd06 agenda: Fix regression in handling of non-caterory filters
* lisp/org-agenda.el (org-agenda-filter-make-matcher): Combine filter
forms with `and' unless multiple positive categories are given.

06cf532f4 (org-agenda.el: Fix bug when using category filters,
2020-01-20) modified org-agenda-filter-make-matcher to group the form
with `or' rather than `and' for category filters.  This logic was
tweaked again in a follow-up commit, 7e52b7661 (org-agenda: Fix logic
of `org-agenda-filter-make-matcher', 2020-02-19), which was supposed
to restrict the use of `or' to _multiple_ positive categories.
However, the follow-up commit incorrectly affected all filter types.
Avoid the check for non-category types.

Also, fix the regexp so that it matches whenever there are multiple
positive categories, not just a single one.

Reported-by: Jorge P. de Morais Neto <jorge+list@disroot.org>
<87v9nhit6c.fsf@disroot.org>
2020-04-07 22:47:37 -04:00
Nicolas Goaziou 06fe9d6b05 ob: Improve handling of :wrap header
* lisp/ob-core.el (org-babel-insert-result): Improve handling of :wrap
header.
* testing/lisp/test-ob.el (test-ob/inline-src_blk-wrap): New test.
(test-ob/preserve-comma-escape): Add test.
2020-04-07 01:42:35 +02:00
Nicolas Goaziou 0a7e382c27 Merge branch 'maint' 2020-04-07 01:22:18 +02:00
Nicolas Goaziou e3373f4beb ob-core: Properly replace results in special blocks
* lisp/ob-core.el (org-babel-result-end): Handle results in special
blocks.
* testing/lisp/test-ob.el (test-ob/replace-special-block-result): New
test.
2020-04-07 01:21:33 +02:00
Nicolas Goaziou fb593f7556 Handle ".+" repeater with hours step
* doc/org-manual.org (Repeated tasks): Document new feature.
* lisp/org.el (org-auto-repeat-maybe): Repeat from now when ".+" is
used in conjunction of hours increment.
* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Add tests.
2020-04-06 15:18:48 +02:00
Marco Wahl 31d1bf86a3 Merge branch 'maint' 2020-03-30 23:23:33 +02:00
Marco Wahl fe34a408f2 org-table: Fix formula at column insert
* lisp/org-table.el (org-table-insert-column): Fix the index.

Report and fix by Yu Han Quek.  https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00290.html

TINYCHANGE
2020-03-30 23:21:22 +02:00
Marco Wahl 50ae73854b ox-publish: Allow plain as lambda preparation/completion-function
* lisp/ox-publish.el (org-publish-projects): Check for function before
  check for cons to capture lambda's as such.

Reported by Arne Babenhauserheide
https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00284.html

(cherry picked from commit fffba5b7fd)
2020-03-30 12:21:39 +02:00
Marco Wahl fffba5b7fd ox-publish: Allow plain as lambda preparation/completion-function
* lisp/ox-publish.el (org-publish-projects): Check for function before
  check for cons to capture lambda's as such.

Reported by Arne Babenhauserheide
https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00284.html
2020-03-30 11:10:12 +02:00
Christian Hopps 8a99404c84 org-clock.el: add semimonth step for clocktables
* lisp/org-clock.el (org-clocktable-steps): Add a semimonth step for
producing clock tables.

Originally proposed "bimonth" as name; however, bimonthly is
ambiguous, as it can mean 2 different things, semimonthly or every 2
months.

TINYCHANGE
2020-03-26 21:03:17 -04:00
Nicolas Goaziou 7a78eb1be0 ol: Fix some corner cases when normalizing context in links
* lisp/ol.el (org-link--normalize-string): Handle blanks between
special characters.
(org-link-heading-search-string): Small refactoring.
* testing/lisp/test-ol.el (test-ol/store-link): Add tests.
2020-03-26 22:57:16 +01:00
Nicolas Goaziou 5b96988706 ol: Prettify suggested description for stored links
* lisp/ol.el (org-store-link): Remove statistics cookies and spurious
white spaces from description, if possible.
2020-03-24 12:32:21 +01:00
Nicolas Goaziou 6ea1ca51a8 ol: Refactor code for clarity
* lisp/ol.el (org-link--normalize-string): New function.
(org-link--squeeze-white-spaces, org-link--clear-syntax-from-context):
Remove functions (merged in the previous one).
(org-link-search):
(org-link-heading-search-string):
(org-store-link): Use new function.
2020-03-24 12:01:50 +01:00
Nicholas Vollmer 097b4e6ca0 Use defvaralias for priority variable aliases
* lisp/org.el (org-highest-priority):
(org-lowest-priority):
(org-default-priority): Define as a variable alias, not a function
alias.

When these variables were renamed in e11f50648 (2020-01-30), variable
aliases were defined for the old names, but these were incorrectly
switched to function aliases in e062ca719 (org.el: Use `defalias' for
priority aliases, 2020-02-24).

<https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00083.html>

TINYCHANGE
2020-03-23 23:48:39 -04:00
Mattias Engdegård b78583a1c1 Backport commit 770f76f05 from Emacs
Make regexps smaller and faster by removing terms that are superfluous
by virtue of standing next to another term that matches more.  See
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00949.html
for details.

* lisp/ob-core.el (org-babel-remove-result):
* lisp/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-compat.el (org-maybe-keyword-time-regexp):
* lisp/org-table.el (org-table-expand-lhs-ranges):
Remove subsumed repetitions.

Remove subsumed repetitions in regexps
770f76f050376bbd77a3cc8cf44db57cf855a27c
Mattias Engdegård
Thu Feb 20 16:05:18 2020 +0100
2020-03-15 22:51:31 -04:00
Mattias Engdegård 0c046aecf0 Backport commit 0c6c8aa00 from Emacs
See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00749.html .

* lisp/org-element.el (org-element--cache-sync-requests):
* lisp/org.el (org-sparse-tree):
Remove redundant backslashes.

Remove (or double) redundant backslashes in string literals
0c6c8aa002d321db61afdd14c70744f7bc27f268
Mattias Engdegård
Fri Jan 24 23:04:34 2020 +0100
2020-03-15 22:51:31 -04:00
Mattias Engdegård 7265f2864e Backport commit af085ef40 from Emacs
* lisp/org-agenda.el (org-agenda-hide-tags-regexp)
(org-agenda-category-icon-alist):
* lisp/org-protocol.el (org-protocol-data-separator):
* lisp/org-table.el (org-table-number-regexp):
* lisp/ox-latex.el (org-latex-known-warnings):
Use 'regexp' instead of 'string' as type for values that are regexps
in defcustom declarations.

Use regexp type for regexps in defcustom declarations
af085ef40b961ca3466e8b2dfb7f722573e5a4cc
Mattias Engdegård
Thu Dec 26 16:50:58 2019 +0100
2020-03-15 22:51:31 -04:00
Kyle Meyer fed3c07390 Update customize-package-emacs-version-alist
* lisp/org.el (customize-package-emacs-version-alist): Map Org 9.4 to
Emacs 28.1.

Emacs 27 is nearing release.  A sync of 9.4 would be with the current
version for Emacs's master branch.
2020-03-15 22:51:24 -04:00
Kyle Meyer 852af41bd9 ox-html: Update a :package-version value
* lisp/ox-html.el (org-html-infojs-template): Update :package-version
for recent default value change, and drop :version in favor of mapping
via customize-package-emacs-version-alist.
2020-03-15 22:07:52 -04:00
Arne Babenhauserheide 661696036f ox-html: escape & in license magnets
* lisp/ox-html.el (org-html-scripts):
(org-html-infojs-template): & escaped as &amp;

This fixes xhtml validation while still being recognized by LibreJS as
valid license.

Reported-by: Colin Baxter <m43cap@yandex.com>
<87eett7bql.fsf@yandex.com>

TINYCHANGE
2020-03-15 20:06:35 -04:00
Nicolas Goaziou b6e3e8f2b6 ox-html: Add missing :package-version keyword
* lisp/ox-html.el (org-html-validation-link): Default value changed,
so update :package-version keyword.
2020-03-15 17:02:01 +01:00
Augustin Fabre 472a171b94 ox-html: Use HTTPS for link to W3 HTML validator
* lisp/ox-html.el (org-html-validation-link): Use HTTPS link to W3
HTML validator.

TINYCHANGE
2020-03-15 16:58:13 +01:00
Nicolas Goaziou d9b1fb1e8c org-compat: Add missing definition
* lisp/org-compat.el (org-maybe-keyword-time-regexp): New variable.

This is a followup to 209fb501bd.
2020-03-12 09:57:24 +01:00
Nicolas Goaziou 209fb501bd org-compat: Mark `org-maybe-keyword-time-regexp' as obsolete
* lisp/org-compat.el (org-maybe-keyword-time-regexp): Make obsolete.
2020-03-12 09:08:27 +01:00
Nicolas Goaziou 7e38f69178 Merge branch 'maint' 2020-03-11 21:53:25 +01:00
Nicolas Goaziou 685b2c4410 org-macro: Fix last commit
* lisp/org-macro.el (org-macro--set-template): Do not override value
with an empty one.

This is a followup to 965cdbfd4b.
2020-03-11 21:52:19 +01:00
Nicolas Goaziou 965cdbfd4b org-macro: Fix {{{author}}} expansion without AUTHOR keyword
* lisp/org-macro.el (org-macro--set-template): Allow setting a nil
value, which becomes an empty template.
* testing/lisp/test-org-macro.el (test-org-macro/author):
(test-org-macro/email):
(test-org-macro/title): New tests.

Reported-by: "Dauer, Michael" <michael.dauer@smartpm.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-03/msg00094.html>
2020-03-11 16:24:26 +01:00
Nicolas Goaziou 4cf8ffdba6 org-macro: Fix {{{author}}} expansion without AUTHOR keyword
* lisp/org-macro.el (org-macro--set-template): Allow setting a nil
value, which becomes an empty template.
* testing/lisp/test-org-macro.el (test-org-macro/author):
(test-org-macro/email):
(test-org-macro/title): New tests.

Reported-by: "Dauer, Michael" <michael.dauer@smartpm.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-03/msg00094.html>
2020-03-11 16:21:49 +01:00
Nicolas Goaziou e18415d02c ob: Fix case when replacing Noweb reference
* lisp/ob-core.el (org-babel-expand-noweb-references): Use FIXEDCASE.
* testing/lisp/test-ob.el (test-ob/noweb-expansion): Add test.

Reported-by: Sebastian Miele <sebastian.miele@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-03/msg00070.html>
2020-03-09 23:10:04 +01:00
Nicolas Goaziou 8b67d79c3b org-clock: Small refactoring
* lisp/org-clock.el (org-clock-get-table-data): Use standard regexp
for statistics cookies.
2020-03-09 22:27:45 +01:00
Nicolas Goaziou 97e415c5df ol: Do not save tags when storing a link from a headline
* lisp/ol.el (org-link-heading-search-string): Assume optional
argument is already valid.  Remove TODO keyword, priority cookie,
COMMENT keyword, and tags.
(org-link-search): Remove COMMENT keyword.
* testing/lisp/test-ol.el (test-ol/store-link): Add tests.
2020-03-09 22:23:11 +01:00
Kyle Meyer 0a8faecb7f Merge branch 'maint' 2020-03-05 23:24:24 -05:00
Tim Visher 70c1eec559 org-attach.el: Use `force' arg everywhere in `org-attach-delete-all'
* lisp/org-attach.el (org-attach-delete-all): Use `force' arg
throughout function.

`org-attach-delete-all` advertised a `force` option but passing it
only forced its way past the initial "Really remove all…" query.  This
was unexpected and not properly documented.

This extends the use of the `force` argument to the `delete-directory`
call and documents its meaning in the docstring.

TINYCHANGE
2020-03-05 23:24:14 -05:00
Bastien a753bad1bf org-timer.el: Remove useless `or' conditional
* lisp/org-timer.el (org-timer--get-timer-title): Remove
useless `or' conditional.
2020-03-02 15:55:45 +01:00
Marco Wahl abf5ab0944 org-timer: Fix timer start from agenda
* lisp/org-timer.el (org-timer--get-timer-title): Return buffer-name
also for agenda lines without complete "org marker".

Reported by Ian Garmaise
https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00004.html
2020-03-01 22:45:35 +01:00
Nicolas Goaziou 041138e47c Remove `org-export-link-as-file'
* lisp/ol.el (org-link-parameters): Remove reference to the function.
* lisp/ox.el (org-export-link-as-file): Remove function.
* testing/lisp/test-ox.el (test-org-export/link-as-file): Remove test.

The current implementation is not satisfactory, and not useful in the
code base. Using a pre-export hook turning custom link type into
"file" is enough for now. See "attachement" links for an example.
2020-02-28 01:30:30 +01:00
Gustav Wikström 0e0df5abf3 attach: translate directly as file links during export
* lisp/org-attach.el (org-attach-expand-links): translate directly as
file links during export.
2020-02-28 01:27:47 +01:00
Nicolas Goaziou 7707f898a1 ol: Fix opening file link with a starred search option
* lisp/ol.el (org-link-open-as-file): Fix logic so initial regexp is
matched against the file-name only, not the search option.
2020-02-26 16:29:32 +01:00
Bastien 30d0b6e1f6 org.el: Tiny enhancements `org-format-latex-as-html'
* lisp/org.el (org-create-math-formula): Use `warn'.
(org-format-latex-as-html): Don't set a free variable, return
the string directly.
2020-02-24 11:43:45 +01:00
Bastien e062ca7199 org.el: Use `defalias' for priority aliases.
* lisp/org.el (org-highest-priority, org-lowest-priority)
(org-default-priority): Use `defalias'.
2020-02-24 11:41:33 +01:00
Bastien 3a543a981b Enhancements to `org-latex-to-html-convert-command'
* lisp/org.el (org-latex-to-html-convert-command): Fix option.

* etc/ORG-NEWS: Document `org-latex-to-html-convert-command'
as a new option.
2020-02-24 11:21:40 +01:00
Matt Huszagh 860cfe7f13 Add an option to convert LaTeX fragments to HTML
* lisp/org.el (org-latex-to-html-convert-command): New option to
convert a LaTeX fragment directly into HTML.
(org-format-latex): Use the new option.
(org-format-latex-as-html): Do the conversion and return HTML.
* lisp/ox-html.el (org-html-with-latex): Document the 'html symbol.
(org-html-format-latex): This custom HTML conversion, like MathJax,
doesn't require preprocessing.
(org-html-latex-fragment): Use the new option.

This allows you to set a custom command
`org-latex-to-html-convert-command' that will take as input a LaTeX
fragment and use it to generate HTML for export.  This is very
open-ended in the sense that you can use any shell-command you
want.  This has been added in order to use latexml, but you could
use any other tool that generates HTML output text.
2020-02-24 11:16:01 +01:00
Bastien f56f2b323a org-id.el: Fix typo in comment
* lisp/org-id.el (org-id-find-id-file): Fix typo in comment.
2020-02-23 14:30:02 +01:00
Bastien 38928848c7 org-id.el: Fix typo in comment
* lisp/org-id.el (org-id-find-id-file): Fix typo in comment.
2020-02-23 14:29:38 +01:00
Nicolas Goaziou a63073ec04 Move obsolete aliases into "org-compat.el" 2020-02-23 12:57:07 +01:00
Nicolas Goaziou ee0dba6402 Small fix to headline search string
* lisp/ol.el (org-link-heading-search-string):
(org-link-search):
* lisp/ox.el (org-export-search-cells): Replace statistics cookies
with a space before squeezing spaces so as to handle properly, e.g.,
"wordCOOKIEword".
2020-02-23 12:51:07 +01:00
Nicolas Goaziou fe5962ce9b Fix some time stamps regexps
* lisp/org.el (org-ts--internal-regexp): New variable.
(org-ts-regexp):
(org-ts-regexp-inactive):
(org-ts-regexp-both): Use new variable.
(org-maybe-keyword-time-regexp): Remove variable.
(org-logbook-drawer-re): Simplify regexp.

Also move "Timestamp" section higher in the library (topological
order). This change should pacify "Relint" checks.
2020-02-23 12:41:33 +01:00
Nicolas Goaziou 83518daf11 Small fix
* lisp/org.el (org-set-tags-command): Also avoid using `looking-back',
in particular without a LIMIT argument.  This silences the
byte-compiler.
2020-02-23 10:30:22 +01:00
Bastien d9d877491b org-archive.el: Add :package-version to an option
* lisp/org-archive.el (org-archive-subtree-save-file-p): Add
:package-version.
2020-02-23 09:42:02 +01:00
Nicolas Goaziou 42ec2462a0 Do not leak "attachment" links
* lisp/ol.el (org-link-open): Remove "attachment" for special cases.
* lisp/org-attach.el (org-attach-expand-links):
(org-attach-follow): New functions.
(org-attach-link-expand): Remove function.
* lisp/org-element.el (org-element-link-parser):
* lisp/ox-ascii.el (org-ascii-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex--inline-image):
(org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-inline-image-rules):
(org-odt-link):
* lisp/ox-texinfo.el (org-texinfo-inline-image-rules):
(org-texinfo-link): Remove "attachment" from special cases.
2020-02-22 14:22:49 +01:00
Bastien 08428fed78 ob-shell.el: Delete `org-babel-shell-return-value-is-exit-status'
* lisp/ob-shell.el (org-babel-sh-evaluate): Return the output
by default.  Return exit status as the "value" when :result is
explicitely set to "value".

* lisp/ob-shell.el
(org-babel-shell-return-value-is-exit-status): Delete option.

* doc/org-manual.org (Collection): Be more accurate.

See the whole thread here:
https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00715.html

Thanks to everyone in this discussion.
2020-02-22 10:58:55 +01:00
Bastien 5dee070fb2 lisp/ol-bbdb.el (org-bbdb-anniversaries): Enhance docstring
* lisp/ol-bbdb.el (org-bbdb-anniversaries): Enhance docstring.

Thanks to Andrés Ramírez for suggesting this.
2020-02-22 10:33:07 +01:00
Bastien e360cd8f3a Change the default values for several options
* doc/org-manual.org (Execute commands in the active region):
Update the manual given the new defaults.

* etc/ORG-NEWS (New default settings for some options): New
section.

* lisp/org.el (org-loop-over-headlines-in-active-region):
Change the default value to `t'.
(org-fontify-done-headline): Ditto.

* lisp/org-agenda.el
(org-agenda-loop-over-headlines-in-active-region): Ditto.

* lisp/org-src.el (org-src-tab-acts-natively): Ditto.
2020-02-21 16:35:56 +01:00
Bastien 450452de4b org.el: Two minor fixes
* lisp/org.el (org-set-tags-command): Fix point position after
setting tag at the beginning of a blank heading.
(org-kill-line): Prevent from throwing an error when killing
the headline while point is right after the * chars.
2020-02-21 16:12:28 +01:00
Bastien 05f294ec5b org.el: Two minor fixes
* lisp/org.el (org-set-tags-command): Fix point position after
setting tag at the beginning of a blank heading.
(org-kill-line): Prevent from throwing an error when killing
the headline while point is right after the * chars.
2020-02-21 16:12:11 +01:00
Bastien 4cd497416f org-agenda.el: Rename two options
* lisp/org-agenda.el (org-sort-agenda-notime-is-late): Make an
obsolete alias to `org-agenda-sort-notime-is-late'.
(org-sort-agenda-noeffort-is-high): Make an obsolete alias to
`org-agenda-sort-noeffort-is-high'.
(org-agenda-finalize-entries, org-cmp-effort, org-cmp-time)
(org-cmp-ts, org-agenda-compare-effort): Use the new names.
2020-02-21 08:29:42 +01:00
Bastien 0c02928eb2 ob-shell.el: Rename `ob-shell-return-value-is-exit-status'
* lisp/ob-shell.el
(org-babel-shell-return-value-is-exit-status): Rename from
`ob-shell-return-value-is-exit-status'.
(org-babel-execute:shell, org-babel-sh-evaluate): Use new name.
(org-babel--variable-assignments:bash_assoc): Fix indentation.
2020-02-21 08:26:37 +01:00
D. Williams 1b2de14d84 org-indent.el: Deprecate `org-hide-leading-stars-before-indent-mode'
* lisp/org-indent.el (org-indent-mode): Make `org-hide-leading-stars'
buffer local and revert it back to it's global value when exiting the
mode without storing it's global value manually.
(org-hide-leading-stars-before-indent-mode): Remove declaration.

This commit implements my suggestion from the mailing list
(https://lists.gnu.org/archive/html/emacs-orgmode/2020-02/msg00759.html)
to rely on Emacs' native mechanisms for restoring a buffer-local
variable to it's global default value instead of storing the global
value in a temporary variable (in this case:
`org-hide-leading-stars-before-indent-mode').

TINYCHANGE
2020-02-20 15:17:21 +01:00
Eric Abrahamsen 6de5bcee87 Skip entries with no ID when updating ID locations
* lisp/org-id.el (org-id-update-id-locations): Saves a little chatter
about duplicate "nil" IDs.
2020-02-19 22:37:25 +01:00
Bastien 6f943b1da5 org.el (org-use-sub-superscripts): Remove old comment in docstring
* lisp/org.el (org-use-sub-superscripts): Remove old comment
in docstring.
2020-02-19 22:26:47 +01:00
Bastien bc75b75d9f org.el (org-special-ctrl-k): Enhance docstring
* lisp/org.el (org-special-ctrl-k): Enhance docstring.

Thanks to Marco Wahl for suggesting this change.
2020-02-19 21:43:31 +01:00
Nicolas Goaziou 0c55d3f421 Remove special syntax from context in file links
* lisp/ol.el (org-link--clear-syntax-from-context): New function.
(org-store-link): Use new function.
2020-02-19 18:42:50 +01:00
Nicolas Goaziou 12c09be3a6 Refactor context part in file links
* lisp/ol.el (org-link--context-from-region):
(org-link--squeeze-white-spaces): New functions.
(org-link-heading-search-string): Refactor code. Always start with an asterisk.
(org-store-link): Use new functions.
* lisp/org-pcomplete.el (pcomplete/org-mode/searchhead):
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/link):
Update tests.
2020-02-19 18:42:50 +01:00
Nicolas Goaziou 8c4e270df2 ol: Refuse to define reserved internal link types
* lisp/ol.el (org-link-set-parameters): Raise an error when trying to
define reserved internal link types.
2020-02-19 18:42:50 +01:00
Nicolas Goaziou f4bed78a19 Move custom links to new tooling
* contrib/lisp/ol-bookmark.el (org-bookmark-open):
* contrib/lisp/ol-elisp-symbol.el (elisp-symbol-open):
* contrib/lisp/ol-git-link.el (org-gitbare-open):
(org-git-open):
* contrib/lisp/ol-man.el (org-man-open):
* contrib/lisp/ol-mew.el (org-mew-open):
* contrib/lisp/ol-notmuch.el (org-notmuch-open):
(org-notmuch-search-open):
(org-notmuch-tree-open):
* contrib/lisp/ol-vm.el (org-vm-open):
(org-vm-imap-open):
* contrib/lisp/ol-wl.el (org-wl-open):
* contrib/lisp/org-mac-link.el (org-mac-together-item-open):
(org-mac-addressbook-item-open):
(org-mac-skim-open):
(org-mac-acrobat-open):
(org-mac-outlook-message-open):
(org-mac-evernote-note-open):
(org-devonthink-item-open):
(org-mac-message-open):
* contrib/lisp/org-mairix.el (org-mairix-open):
* lisp/ol-bbdb.el (org-bbdb-export):
(org-bbdb-open):
* lisp/ol-bibtex.el (org-bibtex-open):
* lisp/ol-docview.el (org-docview-open):
* lisp/ol-eshell.el (org-eshell-open):
* lisp/ol-eww.el ("eww"):
* lisp/ol-gnus.el (org-gnus-open):
* lisp/ol-info.el (org-info-open):
* lisp/ol-irc.el (org-irc-visit):
* lisp/ol-mhe.el (org-mhe-open):
* lisp/ol-rmail.el ("rmail"):
(org-rmail-open):
* lisp/ol.el (org-link--open-doi):
(org-link--open-elisp):
(org-link--open-help):
(org-link--open-shell):
* lisp/org-id.el (org-id-open):
* testing/lisp/test-ox.el (test-org-export/custom-protocol-maybe): Use
new tooling.
* doc/org-manual.org (Adding Hyperlink Types): Adapt example.
2020-02-19 18:42:50 +01:00
Nicolas Goaziou afd3b04ecc ol: Extend open tooling in link parameters
* lisp/ol.el (org-link-parameters): Extend :follow parameter to handle
a second argument.
(org-link-open): Call custom-link functions after internal ones.
(org-link-open-as-file): New function.
(org-link-parameters): Reference new function.
(org-link-open): Use new function.
2020-02-19 18:42:47 +01:00
Nicolas Goaziou ab9166ad29 Extend export tooling in link parameters
* lisp/ol.el (org-link-parameters): Allow a fourth "info" argument for
`:export' property.  Expound docstring.
* lisp/ox.el (org-export-custom-protocol-maybe): Accept a fourth
optional argument.
* lisp/ox-ascii.el (org-ascii--describe-links):
(org-ascii-link):
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link):
* lisp/ox-org.el (org-org-link):
* lisp/ox-texinfo.el (org-texinfo-link):
* contrib/lisp/ox-groff.el (org-groff-link): Provide expected fourth
argument.
* lisp/ox.el (org-export-link-as-file): New function.
* lisp/ol.el (org-link-parameters): Add reference to new function in docstring.
* testing/lisp/test-ox.el (test-org-export/link-as-file): Add tests.
(test-org-export/custom-protocol-maybe): Update tests.
2020-02-19 18:41:37 +01:00
Bastien 9d58806fab Fix 5acf4d4692 2020-02-19 18:10:41 +01:00
Bastien 88d218a5a0 Fix 5acf4d4692 2020-02-19 18:10:26 +01:00