Commit graph

4880 commits

Author SHA1 Message Date
Bastien ee3c3b5547 org.el: Allow empty subtrees to be folded back
* lisp/org.el (org-cycle-internal-local): Allow empty subtrees to
fold back.

See <https://orgmode.org/list/CA+Yh0SRPgeMUYAD0ds3TZnwpPKq8_mpact-OeKK-rXoQNb-eEg@mail.gmail.com>

Reported-by: Dmitrii Korobeinikov <dim1212k@gmail.com>
2020-09-05 08:01:58 +02:00
Bastien 8a3777e35b org.el: Use `string-match-p' in two functions
* lisp/org.el (org-remove-empty-overlays-at)
(org-cycle-internal-global): Use `string-match-p' as match data
are not used.
2020-09-05 08:00:29 +02:00
Dmitrii Korobeinikov a8e812e601 org.el: Restore the scroll position after cycling
* lisp/org.el (org-scroll-position-to-restore): New variable.
(org-optimize-window-after-visibility-change): Use it to restore
the scroll position when needed.

TINYCHANGE

See <https://orgmode.org/list/CA+Yh0STTE+Zx-zct3qy7eyqTovogr_fqwwOCLx9z3da7_hFRnw@mail.gmail.com>
2020-09-05 07:28:20 +02:00
Bastien 3c524c5fd5 org.el: Fix the "version" keyword in the header
* lisp/org.el: Fix the "version" keyword in the header.
2020-09-05 07:28:20 +02:00
Bastien Guerry a3576543f5 org.el: Fix `org-display-outline-path'
* lisp/org.el (org-display-outline-path): Always remove faces when
setting the outline path to display.

See <https://orgmode.org/list/21ef0e94-e766-455c-a45c-fe30e316c121@Spark>
2020-09-04 10:03:48 +02:00
Allen Li 76da93aa86 org.el: Don't exclude local tags that are also inherited
This fixes a bug in set-tags-command excluding a tag that is both set
locally and inherited from the initial minibuffer input by modifying
org-get-tags to prefer keeping the locally set tag over the inherited
tag, as this behavior is more intuitive for org-get-tags anyway.

* lisp/org.el (org-get-tags): Keep local tags over inherited.
* testing/lisp/test-org.el (test-org/set-tags-command): Add test.
2020-08-23 22:38:20 -04:00
Nicholas Vollmer ab9b14a80f org.el: (org-get-cursor-date): Fix regular expression
* lisp/org.el (org-get-cursor-date): Fix regular expression.

Previous regular expression assumed the time grid string will have two
digits in the hour portion of the time string.  However, the time grid
string does not always have two digits.  For example:

" 8:00......"
2020-08-10 20:35:36 -04:00
Kévin Le Gouguec 81e2948472 Fix org-fontify-whole-*-line by setting face extension (bug#42184)
* lisp/org-faces.el (org-block): Set background extension beyond
end-of-line.
* lisp/org-compat.el (org--set-faces-extend): New function to
temporarily (re)set :extend for Emacs≥27.
* lisp/org.el (org-mode): Call it to set the extend attribute of
relevant faces to the correct value.
2020-08-10 20:22:25 -04:00
Leo Vivier c9abb4c29a org: Remove useless example in docstring
* lisp/org.el (org-find-olp): Remove useless example in docstring.

TINYCHANGE
2020-07-22 23:30:58 -04:00
Kyle Meyer 3ed035ce3b org.el: Clarify argument in org-todo's call to org-map-entries
* lisp/org.el (org-todo): Use nil instead of
org-loop-over-headlines-in-active-region as the MATCH argument.

org-loop-over-headlines-in-active-region isn't related to the MATCH
argument; it's related to SCOPE and decides the value of the let-bound
cl variable that's passed as SCOPE.  Note, though, that
org-loop-over-headlines-in-active-region is let-bound to nil around
the org-map-entries call, so this didn't cause any issues.
2020-06-28 02:27:49 -04:00
Kyle Meyer 8a2eb7d1bc org.el: Fix org-todo argument handling when looping over region
* lisp/org.el (org-todo): Replace backquote construct, which did not
properly quote argument, with closure.

Using "',arg" instead of ",arg" would also work.

Reported-by: Mario Frasca <mario@anche.no>
https://orgmode.org/list/ea64d98c-d7bf-eea0-40d4-00a1515bdb98@anche.no
2020-06-28 02:13:58 -04:00
Kyle Meyer ba6ca79af5 org.el: Fix #+end_src fontification error
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Rewrite the "line
begins with *" check so that it does not assume that match data has
remained intact.

The upstream call to org-src-font-lock-fontify-block overwrites the
match data in some cases.  As a result, (match-string 1) signals an
error and #+end_src is not fontified.  Wrapping the call to
org-src-font-lock-fontify-block with save-match-data would fix the
reported issue.  However, the position at the beginning of the line is
already stored in a variable, so use that information instead to check
whether the line starts with "*".

Reported-by: John Ciolfi <ciolfi@mathworks.com>
<r9r1ulpctz.fsf@ah-ciolfi-lah-ciolfi-l.dhcp.mathworks.com>
2020-06-13 15:17:58 -04:00
Bastien Guerry fa4dddf8d2 Fix broken links
* lisp/org.el:
* lisp/ol-bibtex.el:
* etc/ORG-NEWS (org-capture.el is now the default capture system):
* doc/org-manual.org (Cache results of evaluation): Fix broken links.
2020-06-05 10:39:52 +02:00
Nicolas Goaziou 2c980de073 Prevent one-char invisible overlay at end of buffer
* lisp/org.el (org-cycle-internal-local): Do not create a one
character overlay at the end of buffer.
2020-06-01 22:07:01 +02:00
Nicolas Goaziou 65fdf2be16 Fix `org-mark-element' in narrowed buffers
* lisp/org.el (org-mark-element): Do not set mark past narrowed part
of the buffer.
* testing/lisp/test-org.el (test-org/mark-element): New test.

Reported-by: Kevin Liu <kevin@nivekuil.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00812.html>
2020-05-31 13:55:47 +02: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
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 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
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
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 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
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
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 10607d45ae org.el: Fix typo in docstring
* lisp/org.el (org-special-ctrl-k): Fix typo in docstring.
2020-02-19 14:34:58 +01:00
Bastien fb188adda0 org.el: Move `org-agenda-diary-file' to org-agenda.el
* lisp/org-agenda.el (org-agenda-diary-file): Move from org.el.
* lisp/org-colview.el (org-agenda-diary-file): Move to org-agenda.el.
2020-02-17 14:22:30 +01:00
Bastien 29f44df758 Fix fa24cd541 again 2020-02-14 08:36:54 +01:00
Bastien 66810d2121 Bump version to 9.3.6 2020-02-13 08:47:28 +01:00
Mattias Engdegård 7c63da6fb9 Backport commit 32763dac4 from Emacs
Since 'add-to-list', being a plain function, cannot access lexical
variables, such use must be rewritten for correctness.
(Some instances actually do work thanks to a compiler macro,
but it's not something code should rely on.)

* lisp/org.el (org-reload): Replace add-to-list with push.

Replace add-to-list to lexical variable with push (bug#39373)
32763dac46e61cc34e8fe4d19df4905d09c1a27f
Mattias Engdegård
Sat Feb 1 22:27:23 2020 +0100
2020-02-13 00:02:47 -05:00
Bastien 9712d1cdff Only fontify emphasis markers when they are visible
* lisp/org.el (org-do-emphasis-faces): Only fontify emphasis
markers when they are visible.

Thanks to d.williams for provided a bug report and this fix.
2020-02-13 00:10:33 +01:00
Bastien fa24cd541d org.el (org-babel-load-file): Don't get fooled by symlinks
* lisp/org.el (org-babel-load-file): Don't get fooled by symlinks.
2020-02-12 17:43:02 +01:00
Bastien a03e57cdaf Bump version for 9.3.5 2020-02-12 11:27:01 +01:00
Bastien 95ff24dfc4 org.el: Fix bug occurring when setting effort value
* lisp/org.el (org-refresh-property)
(org-refresh-category-properties): Tiny docstring or comment
fixes.
(org-set-effort): Fail early when the effort value is wrong.

Thanks to Firmin Martin for reporting this.
2020-02-11 10:06:13 +01:00
Bastien f7175e4878 org.el: Fix bug about cycling
* lisp/org.el (org-cycle-internal-local): Handle
`org-cycle-include-plain-lists'.

Thanks to Bruce Tulloch for reporting this.
This fixes a bug introduced in commit c2aebcee.
2020-02-11 07:54:36 +01:00
Bastien a0f3bbd3c2 Revert "org.el: Fix `org-indent-region' bug in source block"
This reverts commit 321b119c44.
2020-02-09 17:48:19 +01:00
Bastien c524b7f51a Bump version 2020-02-05 09:36:55 +01:00
Bastien 321b119c44 org.el: Fix `org-indent-region' bug in source block
* lisp/org.el (org-indent-region): Use `save-window-excursion'
to restore point after indenting region in source blocks.

Thanks to Gustavo Barros for reporting this bug.
2020-02-04 17:04:15 +01:00
Bastien 2cfcdeab96 org.el: Fix `org-[scheduled|deadline]-time-hour-regexp'
* lisp/org.el (org-deadline-time-hour-regexp)
(org-scheduled-time-hour-regexp): Also match habits.

Thanks to Damian for reporting this.
2020-02-04 08:58:15 +01:00
Bastien 1d97b730d2 Delete unused variable 2020-01-30 15:40:22 +01:00
Bastien c2aebcee27 org.el: Fix bug about visibility cycling
* lisp/org.el (org-cycle-internal-local): When cycling visibility
on a subtree, don't take a list has a child.

These two subtrees should cycle the same way:

* A subtree

A Paragraph.

* A subtree

- A list.

Before the fix, the second subtree would cycle through three steps
instead of two.

Thanks to Samuel Wales for reporting this.
2020-01-29 21:39:52 +01:00
Bastien 1930f10b6f Silence compiler warning
* lisp/org.el (org-open-at-point): Delete unused let binding.
2020-01-27 16:12:19 +01:00
Bastien e982108445 Fix "Maintainer: " entry in the header
* lisp/org.el:
* lisp/org-table.el:
* lisp/org-list.el:
* lisp/org-attach.el:
* lisp/org-agenda.el: Fix "Maintainer: " entry in the header.
2020-01-27 14:55:15 +01:00
Bastien da18a958f1 org.el: Adding maintainer
(Testing post-receive hook to trigger a release on the server.)
2020-01-26 12:05:02 +01:00
Bastien 1d426e4a59 Bump version number to 9.3.2 2020-01-26 11:05:20 +01:00
Bastien ac2c0f9a75 org.el: Don't forceably try ot open attachments
* lisp/org.el (org-open-at-point): Don't forceably try ot open
attachments.

This commit fixes a bug: when trying to open links in a subtree with
no attachments, `org-open-at-point' would create an ID property with
no apparent reason.
2020-01-26 08:44:16 +01:00
Bastien c8975ec150 org.el: Fix ID property retrieval
* org.el (org-clone-subtree-with-time-shift): Fix ID property
retrieval.
2020-01-25 20:41:48 +01:00
Nicolas Goaziou 2931bef9e7 Move `org-find-(visible|invisible)' to org-macs.el
* lisp/org.el (org-find-visible):
(org-find-invisible): Move functions...
* lisp/org-macs.el: ... here.
2020-01-11 20:15:30 +01:00
Nicolas Goaziou b8f4773bfe Fix "find-visible" functions
* lisp/org.el (org-find-visible):
(org-find-invisible): Return appropriate position.  Add a docstring.
2020-01-11 20:04:19 +01:00
Kyle Meyer ff5fc050d3 Update copyright year to 2020 2020-01-01 13:38:46 -05:00