Commit Graph

24127 Commits

Author SHA1 Message Date
Juan Manuel Macías df9b509a6c lisp/org-attach-git.el: New option `org-attach-git-dir'
* lisp/org-attach-git.el (org-attach-git-dir): New option to allow
using the attachment directory of the current node as a Git
repository, if correctly initialized.
(org-attach-git-use-annex, org-attach-git-annex-get-maybe)
(org-attach-git-commit): Use the new option.

* etc/ORG-NEWS: Announce the new option.

Link: https://orgmode.org/list/87y2g8rj7s.fsf@posteo.net/
2021-05-15 16:13:49 +02:00
Bastien 83ab852478 etc/ORG-NEWS: Various enhancements 2021-05-15 16:13:49 +02:00
Juan Manuel Macías 91373e15c8 ox-latex.el: Support specific attributes for verse block
* lisp/ox-latex.el (org-latex-verse-block): Support verse-specific
attributes.

* doc/org-manual.org (Verse blocks in LaTeX export): New section.

Link: https://orgmode.org/list/874kfdn0k5.fsf@posteo.net/
2021-05-15 16:13:49 +02:00
Thomas S. Dye ee40458d00 lisp/ox-latex.el: Allow arbitrary float environments
* lisp/ox-latex.el (org-latex--inline-image)
(org-latex--decorate-table): Recognize arbitrary :float value.

* etc/ORG-NEWS: Announce new :float capability.

LaTeX users are able to define arbitrary float types.
This patch makes them accessible from Org mode.
2021-05-15 16:13:49 +02:00
Ihor Radchenko 72894cde6f Allow moving inlinetasks using org-metaup/down
* lisp/org.el (org-metaup, org-metadown): Use
`org-drag-elementbackward'/`org-drag-element-forward' to move
inlinetasks.
2021-05-15 16:13:49 +02:00
Bastien 81c7a2dee8 lisp/org-agenda.el: Use "09:00" instead of " 9:00"
* lisp/org-agenda.el (org-get-time-of-day): Use "09:00" instead
of " 9:00" when displaying as a string.

This makes the string more readable, especially for users reading
the agenda with a screen reader.

Reported-by: Sébastien Hinderer
2021-05-15 16:13:49 +02:00
Kévin Le Gouguec f0447de941 Set org-adapt-indentation explicitly in some tests
* testing/lisp/test-org.el (test-org/indent-line)
(test-org/indent-region): Make sure `org-adapt-indentation' is
consistent with expected results.
2021-05-15 16:13:49 +02:00
Kévin Le Gouguec b183315e16 Set org-adapt-indentation explicitly in some tests
* testing/lisp/test-org.el (test-org/with-electric-indent)
(test-org/without-electric-indent): Make sure
`org-adapt-indentation' is consistent with expected results.
2021-05-15 16:13:49 +02:00
Ihor Radchenko 3f59ea981c Add a test for known bug in org-element-cache
* testing/lisp/test-org-element.el (test-org-element/cache-bugs): A
new test documenting a known bug:

1. Create initial file like:

P0

  P1
  | a | b |
<point>| c | d |

Note that second line of the table is not indented.  Now,
org-element-at-point returns table-row.

2. Modify the file to test org-element-cache

P0

- item

  P1
  | a | b |
<point>| c | d |

Now, the first (indented) row of the table belongs to item.  The
second row should be an individual table and org-element-at-point
returns table.
2021-05-15 16:13:49 +02:00
Bastien c6d11502e0 Fix code typo in 06c064e9 (take 2) 2021-05-15 16:13:49 +02:00
Bastien e53572e130 Fix code typo in 06c064e9 2021-05-15 16:13:49 +02:00
Adam Spiers 33027f992d New command `org-refile-reverse' bound to C-c C-M-w
* lisp/org-refile.el (org-refile-reverse): New command.

* lisp/org-keys.el (org-mode-map): Bind C-c C-M-w to
`org-refile-reverse'.

* doc/org-manual.org (Refile and Copy): Document
`org-refile-reverse'.

* etc/ORG-NEWS (New command ~org-refile-reverse~ (=C-c C-M-w=)):
Announce the new command.

Link: https://orgmode.org/list/20200830001047.21362-1-orgmode@adamspiers.org/
2021-05-15 16:13:49 +02:00
Ihor Radchenko 8f39743ce6 Use cache in org-up-heading-safe
* lisp/org.el (org-up-heading-safe): Use buffer-local cache to store
positions of parent headings.  The cache is invalidated when buffer
text is changed, according to `buffer-chars-modified-tick'.
(org--up-heading-cache):  Buffer-local hash-table storing the cache.
(org--up-heading-cache-tick):  The buffer modification state for
currently active `org--up-heading-cache'.

The optimisation is critical when running agenda or org-entry-get
queries using property/tag inheritance.  In such scenarios
`org-up-heading-safe' can be called thousands of times.  For example,
building todo agenda on large number of headings lead to the following
benchmark results:

Benchmark:

1. (elp-instrument-function #'org-up-heading-safe)
2. Run agenda
3. (elp-results) ;; function, # calls, total time, avg time

Without cache:
org-up-heading-safe  27555       8.4234025759  0.0003056941

With cache, first run:
org-up-heading-safe  23227       0.5300747539  2.282...e-05

With cache, second run on unchanged buffer:
org-up-heading-safe  23227       0.1447754880  6.233...e-06

The final speedup is 1-2 orders of magnitude (~15-56 times).
2021-05-15 16:13:49 +02:00
Bastien 24473b5e08 lisp/org.el: Use "[BUG]" instead of "Bug:" for bug reports
* lisp/org.el (org-submit-bug-report): Use "[BUG]" as the subject
prefix.
2021-05-15 16:13:49 +02:00
Ihor Radchenko f318cd6c40 Fix test-org-element/cache "Preserve local structures when re-parenting."
* testing/lisp/test-org-element.el (test-org-element/cache): Add
spaces to make the "abcd" table a single table.  The old version uses
example org text with two tables and was passing because of another
bug in org-element-cache.  Testing the old version with
org-element-use-cache set to nil would yield error, while it should
not.
2021-05-15 16:13:49 +02:00
Bastien bfda3cc7df lisp/org.el: Don't let RET indent in source code blocks
* lisp/org.el (org-return): Don't try to indent in source code
blocks.

Reported-by: Nathaniel W Griswold <nate@manicmind.earth>
Link: https://orgmode.org/list/5DCBAF63-0E88-44AC-B892-1260F37E7E00@manicmind.earth/
2021-05-15 16:13:49 +02:00
Bastien 99d873b9c3 lisp/org.el: Fix indenting of planning line
* lisp/org.el (org-indent-line): Fix indenting of planning line.
2021-05-15 16:13:49 +02:00
Ihor Radchenko 7dcb1afb69 Improve org-link-plain-re
* lisp/ol.el (org-link-make-regexps): Allow URLs with up to two
levels of nested brackets.

* lisp/org.el (org-link-plain-re): Update docstring.

* testing/lisp/test-ol.el: Add tests for the plain link regular
expression.

(org-link-plain-re): Update docstring.  Now,

Now, URLs like [1] can be matched.  The new regexp is based on [2].
The docstring of `org-link-plain-re'  explicitly mentions that the
regexp must contain groups for the link type and the path.

[1] https://doi.org/10.1016/0160-791x(79)90023-x
[2] https://daringfireball.net/2010/07/improved_regex_for_matching_urls
2021-05-15 16:13:49 +02:00
satotake f00ad09e25 org-refile.el: Fix the case of emtpy buffer name
* lisp/org-refile.el (org-refile-get-targets): Ensure that the
arguments of `file-name-nondirectory' and `file-truename' are not nil.

This prevents errors from being raised when calling `org-refile' in a
buffer that is not visiting a file.

TINYCHANGE
2021-05-15 16:13:49 +02:00
Bastien 8531bb615c lisp/org.el: Minor aesthetic clean-up 2021-05-15 16:13:49 +02:00
Samim Pezeshki 90a9ee1741 lisp/org-agenda.el: Fix bug in `org-agenda-highlight-todo'
* lisp/org-agenda.el (org-agenda-highlight-todo): Skip formatting
the to-do keyword when `org-agenda-todo-keyword-format' is the
empty string.

TINYCHANGE
2021-05-15 16:13:49 +02:00
Bastien 5a0f6c9f75 lisp/ox-md.el: Mark some arguments as unused
* lisp/ox-md.el (org-md-latex-environment)
(org-md-latex-fragment): Mark some arguments as unused.
2021-05-15 16:13:49 +02:00
Bastien dd88356d3a lisp/org-inlinetask.el: Silent the byte-compiler
* lisp/org-inlinetask.el (org-inlinetask-promote)
(org-inlinetask-demote): Fix calls to `looking-back'.
2021-05-15 16:13:49 +02:00
Bastien fa3c9c8b69 lisp/org-id.el: Small enhancements
* lisp/org-id.el (org-id-locations-load, org-id-add-location):
Update messages.
(org-id-hash-to-alist, org-id-paste-tracker, org-id-find-id-file):
Docstring minor enhancements.
(org-id-new): Tiny refactoring.
2021-05-15 16:13:49 +02:00
Bastien 3581f3730f CONTRIBUTE: Small enhancements 2021-05-14 21:24:52 +02:00
Bastien 0e39bf839a Throw user errors when trying to drag inline tasks
* lisp/org.el (org-metaup, org-metadown): Throw a user error
explaining that dragging inline tasks is not supported.

* lisp/org-inlinetask.el (org-inlinetask-insert-task)
(org-inlinetask-promote, org-inlinetask-demote): Fix bug when
demoting/promoting inline tasks at the end of the buffer and
throw user errors instead of errors.

Based on an initial patch by Carsten.

Reported-by: Christian Hemminghaus <chrhemmi@gmail.com>
Link: https://orgmode.org/list/CAE47VC=yhObXs3jexLUkf53cNzcOWUkTMqpF8QK4Dcg98QijyQ@mail.gmail.com/
2021-05-14 21:24:52 +02:00
Nicolas Goaziou dcb6013fb6 agenda: Fix org-duration-to-minutes error (take 2)
* lisp/org.el (org-stamp-time-of-day-regexp): Limit match group 2 to
first time.
* lisp/org-agenda.el (org-agenda-format-item): Compute duration before
formatting time with `org-get-time-of-day'.
2021-05-12 06:37:54 +02:00
Bastien 88fbe21a88 Add Luc Pellissier as maintainer for two ob-* files
* lisp/ob-coq.el: Add a maintainer.

* lisp/ob-asymptote.el: Ditto.
2021-05-12 06:30:22 +02:00
Nicolas Goaziou 9a7207404c Merge branch 'maint' 2021-05-10 18:02:32 +02:00
Nicolas Goaziou 6107c2b15b Revert "agenda: Fix "org-duration-to-minutes: Invalid duration format" error"
This reverts commit bc857bfc62.

The "fix" breaks elsewhere, as reported below.

Reported-by: Daniel Ortmann <daniel.ortmann@oracle.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00592.html>
2021-05-10 18:00:58 +02:00
Timothy 981f25031d
ox-md: Use TeX-style $ math wrapping
* lisp/ox-md.el (org-md-latex-environment, org-md-latex-fragment):
These two new filters wrap LaTeX maths in $ / $$ TeX-style notation.
While ox-md endeavours to adhere to the original Markdown specification,
and not any particular variant, the original specification does not deal
with LaTeX fragments at all, and so this change does not reduce how
faithfully the original specification is followed.
There is a major upside to this though. Of the many Markdown variants
that have emerged, those that support LaTeX very often exclusively
support TeX style notation.  This change thus improves the utility of
the Markdown export for many use cases, and deviates no more from the
original specification that the current method.
2021-05-10 04:11:00 +08:00
Nicolas Goaziou 6f1ea80bbd Merge branch 'maint' 2021-05-09 21:51:17 +02:00
Nicolas Goaziou bc857bfc62 agenda: Fix "org-duration-to-minutes: Invalid duration format" error
* lisp/org-agenda.el (org-agenda-format-item): Compute duration with
`org-duration-to-minutes' before normalizing input.

Reported-by: Stephen Eglen <sje30@cam.ac.uk>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00584.html>
2021-05-09 21:49:23 +02:00
TEC 2ae308342a
org-plot: Fix calling at start of #+plot line
* lisp/org-plot.el (org-plot/gnuplot): When called with point at the
start of the #+plot: line, the behaviour of `org-table-begin' (called in
`org-table-to-lisp') caused no table to be detected.  To work around
this, when the point is at the zeroth column, it is temporarily shifted
one character to the right.
2021-05-09 23:49:46 +08:00
TEC 7dd667af67
org-plot: Use labels with 2d histogram plot
* lisp/org-plot.el (org-plot/preset-plot-types): When the :with
parameter is histograms, use text indices as the x-values.
2021-05-09 23:49:37 +08:00
Boruch Baum 5d2ccdae7f ol-w3m: handle w3m-image link information
* ol-w3m.el (org-w3m-copy-for-org-mode)
(org-w3m-get-next-link-start, org-w3m-get-prev-link-start):
Account for w3m-img links.
(org-w3m-get-anchor-start, org-w3m-get-prev-link-start)
(org-w3m-no-prev-link-p): Unused function notes.
(org-w3m-get-image-end): New function, for w3m-img links.

Related to Emacs bug #47088.
2021-05-08 07:31:50 -04:00
Bastien 348ecd8789 lisp/ob-awk.el: Add Tyler Smith as the maintainer 2021-05-08 09:40:23 +02:00
Bastien da2938d352 Merge branch 'maint' 2021-05-08 09:37:36 +02:00
Bastien 2956c86c20 lisp/ox-html.el (org-html-scripts): Fix missing curly bracket
* lisp/ox-html.el (org-html-scripts): Fix missing curly bracket.

Reported-by: Sebastian Berntsson <sebastian@ilait.se>
Link: https://orgmode.org/list/21ac82d9-91a5-fbdf-c22c-302f28d58ebe@ilait.se/
2021-05-08 09:37:11 +02:00
Stefan Kangas f1b9119954 lisp/org.el: Make `org-load-hook' obsolete
* lisp/org.el (org-load-hook): Make obsolete in favor of
`with-eval-after-load'.
2021-05-08 09:33:37 +02:00
Bastien 0f2ece647b Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
Tom Gillespie cbc1f96c41 lisp/ob-calc.el: Add Tom Gillespie as the maintainer
* lisp/ob-calc.el: Add Tom Gillespie as the maintainer.
2021-05-07 09:31:36 +02:00
Bastien 97d9460945 Merge branch 'maint' 2021-05-07 07:18:16 +02:00
Bastien 4d26075039 doc/org-manual.org (Features Overview): Fix typo
* doc/org-manual.org (Features Overview): Fix typo.

Reported-by: Ian Nehera <delta29@shaw.ca>
2021-05-07 07:17:48 +02:00
Bastien eb3de47d25 Merge branch 'maint' 2021-05-06 14:40:38 +02:00
Bastien b4b35fc92d lisp/ol.el: Fix bug when storing links
* lisp/ol.el (org-store-link): Don' store two links when an a
radio link within a headline that contains a CUSTOM_ID property.

Reported-by: Fr Ml <fr_ml@t-online.de>
Link: https://orgmode.org/list/aadb23f3-c0fe-19aa-be79-50e51d16c41a@t-online.de/
2021-05-06 14:39:14 +02:00
Bastien f95a5cbacb Merge branch 'maint' 2021-05-06 13:51:52 +02:00
Bastien 3f39608857 lisp/org.el: Fix inserting a heading before the first entry
* lisp/org.el (org-insert-heading): When inserting a headline
before the first one, insert a blank line after the inserted
heading if the previous call to `org--blank-before-heading-p'
returned `t'.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87y2cxoybz.fsf@gmail.com/
2021-05-06 13:50:21 +02:00
Sébastien Miquel 6e5b39acd1 ob-tangle.el: Fix single block tangle
lisp/ob-tangle.el (org-babel-tangle-single-block): Fix the result when
`only-this-block' is `t' to match what is expected by
`org-babel-tangle'.
(org-babel-effective-tangled-filename): Extract the
computation of filename of tangled src block.
(org-babel-tangle-collect-blocks): Use `org-babel-effective-tangled-filename'.
2021-05-06 13:37:18 +02:00
Atlas48 bfc3d18b04 lisp/org-entities.el (org-entities): Add the Turkic dotted and dotless 'i'
* lisp/org-entities.el (org-entities): Add the Turkic dotted and
dotless 'i'.

TINYCHANGE
2021-05-06 13:10:18 +02:00