Commit Graph

5069 Commits

Author SHA1 Message Date
Bastien 11ef7454ab org.el (org-fixup-indentation): Fix logbook drawers indentation
* lisp/org.el (org-fixup-indentation): Fix logbook drawers
indentation.

Reported-by: Matt Lundin <mdl@imapmail.org>
https://orgmode.org/list/87r1t8sdhd.fsf@fastmail.fm/
2020-09-07 09:17:21 +02:00
Bastien 69a91ba8bc Merge branch 'maint' 2020-09-07 07:32:28 +02:00
Bastien 7769518f3a Use the `org-block' face for every true blocks
* lisp/org-faces.el (org-block): Tiny docstring enhancement.

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Use the
`org-block' face for every true blocks.

Reported-by: Sébastien Miquel <sebastien.miquel@posteo.eu>
https://orgmode.org/list/42749c98-ddfe-bad4-43a5-1119e24972bd@posteo.eu
2020-09-07 07:31:11 +02:00
Bastien 9f0af69dd2 Skip archived headings when tangling and exporting
* lisp/org.el (org-in-archived-heading-p): New function.

* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Use
`org-in-archived-heading-p' to skip archived headings when tangling
and exporting.

* testing/lisp/test-org.el (test-org/in-archived-heading-p): Add
test for `org-in-archived-heading-p'.

Reported-by: flare <gabrielxaviersmith@gmail.com>
See https://orgmode.org/list/877dt9ey2c.fsf@gmail.com/
2020-09-07 06:51:06 +02:00
Bastien 73a78c2518 Revert "org.el (org-add-planning-info): Use caller's `org-time-was-given' value"
This reverts commit c7abcd514a.
2020-09-06 12:01:54 +02:00
Bastien 55d1d32f5e org.el: Tiny docstring fixes
* lisp/org.el (org-keyword-regexp, org-ctrl-k-protect-subtree)
(org-priority-default, org-fast-tag-selection-single-key)
(org--check-org-structure-template-alist)
(org-after-todo-statistics-hook, org-log-note-effective-time)
(org-occur, org-days-to-iso-week, org-ctrl-c-ctrl-c-hook)
(org-ctrl-c-ctrl-c-final-hook, org-ctrl-c-ret, org-mode-restart)
(org-install-agenda-files-menu): Tiny docstring fixes.
2020-09-06 08:14:15 +02:00
Kyle Meyer 799e5dac92 org.el: Silence byte-compiler
* lisp/org.el (org-optimize-window-after-visibility-change): Drop
unused let-binding added in a8e812e60.
2020-09-05 23:39:56 -04:00
Nicholas Vollmer c7abcd514a org.el (org-add-planning-info): Use caller's `org-time-was-given' value
* lisp/org.el (org-add-planning-info): Fix bug by not ignoring the
caller's `org-time-was-given' value.

See <https://orgmode.org/list/87zh6rfvmi.fsf@gmail.com>

TINYCHANGE
2020-09-05 17:54:46 +02:00
Bastien c09518b5f6 org.el (org-read-date-display-live): Enhance docstring
* lisp/org.el (org-read-date-display-live): Document that live
display is only available when `org-read-date-popup-calendar' is
non-nil.

See <https://orgmod.org/list/20200630180259.zj3krk57x5iqmbsj@orion>

Reported-by: Edmund Christian Herenz <eherenz@eso.org>
2020-09-05 17:33:04 +02:00
Bastien 8538654591 Merge branch 'maint' 2020-09-05 11:09:52 +02:00
E.L.K f2d41de3ed Fix bug when building sparse tree: ignore non-buffer tags
* lisp/org.el (org-make-tags-matcher): Add a parameter to make it
optional to include non-buffer tags.
(org-match-sparse-tree): Use the new parameter.

TINYCHANGE
2020-09-05 11:08:32 +02:00
Bastien 42bd67fdf0 Merge branch 'maint' 2020-09-05 08:03:12 +02:00
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
Bastien 5beeb094a2 Merge branch 'maint' 2020-09-05 07:30:47 +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
Kyle Meyer cdfc404bed Merge branch 'maint' into master 2020-08-23 22:39:44 -04: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
Kyle Meyer 5417e384eb Merge branch 'maint' 2020-08-10 20:38:18 -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
Nicolas Goaziou 270aa438e2 Fix `org-show-children' error when called before first heading
* lisp/org.el (org-show-children): Fix `org-show-children' error when
called before first heading.
2020-07-27 19:22:46 +02:00
Kyle Meyer 82b496c0e9 Merge branch 'maint' 2020-07-22 23:33:07 -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
Marco Wahl 7069dc3f32 org: New function to hide the body up to the first child
* lisp/org.el (org-hide-entry): New function. Counterpart to org-show-entry.
2020-07-21 12:14:10 +02:00
Nicolas Goaziou 91b2398293 Do not fill paragraph before region
* lisp/org.el (org-fill-paragraph): Do not fill paragraph before
region.
* testing/lisp/test-org.el (test-org/fill-paragraph): Add test.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://lists.gnu.org/r/emacs-orgmode/2020-07/msg00164.html>
2020-07-14 11:46:38 +02:00
Nick Dokos bc4fa8a008 org: add property names from #+PROPERTY keywords to completion list
* lisp/org.el (org-buffer-property-keys): Enhance the completion list
with property names from #+PROPERTY keywords, not just property
drawers. Also, for each xxx_ALL property, make sure that the bare xxx
property is added too.

* testing/lisp/test-org.el (test-org/buffer-property-keys): Add test
cases for #+PROPERTY keywords and also for xxx_ALL --> xxx properties.

See https://emacs.stackexchange.com/questions/59448/ for details.

Modified-by: Kyle Meyer <kyle@kyleam.com>
  Cosmetic tweaks to _ALL stripping.
2020-07-07 23:37:54 -04:00
Nicolas Goaziou 353e8cc2b7 Fix paragraph filling
* lisp/org.el (org-fill-paragraph): Fix regression introduced in
e2b62b4da8.
* testing/lisp/test-org.el (test-org/fill-paragraph): New test.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-07/msg00065.html>
2020-07-07 10:37:35 +02:00
Marco Wahl ab864a29be org: Improve consistency for org-ctrl-c-tab and children folding
* lisp/org.el (org-ctrl-c-tab): Don't move point when acting on
  outline level 0 (which is before first heading). This is consistent to
  the behavior for level > 0. And refactor some. And correct the
  docstring.
2020-07-07 00:39:35 +02:00
Marco Wahl 8b92bcd827 org: Enable org-show-entry before first heading
* lisp/org.el (org-show-entry): Before first heading show the region
  up to the first heading. Remove the now useless ignore-errors.

This behavior allows to reveal invisible text before the first
heading.
2020-07-07 00:12:39 +02:00
Nicolas Goaziou a3f01e183f Tweak drawer visibility after isearch
* lisp/org-macs.el (org-flag-region): Control visibility state after
an isearch.
* lisp/org.el (org-mode): Remove an unused variable.
2020-07-04 09:56:20 +02:00
Nicolas Goaziou e3745fac1e Remove `org-hide-drawer' text property leftovers
* lisp/org-macs.el (org-save-outline-visibility):
(org-invisible-p):
* lisp/org.el (org-show-set-visibility):
(org--forward-paragraph-once):
(org--backward-paragraph-once): Remove reference to `org-hide-drawer',
no longer used to hide drawers.
2020-07-03 21:50:46 +02:00
Kyle Meyer 15029c8abb Merge branch 'maint' 2020-06-28 02:29:12 -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
Marco Wahl 945f495b94 org: Enable join of multiple lines
* lisp/org.el (org-delete-indentation): Call delete-indentation via
the call-interactive wrapper to take into account a possibly selected
region.
2020-06-17 12:58:34 +02:00
Kyle Meyer a8cc4f7244 Merge branch 'maint' 2020-06-13 15:18:12 -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
Nicolas Goaziou c709187173 Do not widen when folding all drawers
* lisp/org.el (org-cycle-hide-drawers): Do not widen drawer.
2020-06-13 17:51:30 +02:00
Nicolas Goaziou e2b62b4da8 Rewrite `org-forward-paragraph' and `org-backward-paragraph'
* lisp/org.el (org-forward-paragraph):
(org-backward-paragraph): Rewrite functions.  Add repeat argument.
Mimic more closely regular `forward|backward-paragraph' functions.
(org--forward-paragraph-once):
(org--backward-paragraph-once):
(org--paragraph-at-point): New functions.
* testing/lisp/test-org.el (test-org/forward-paragraph):
(test-org/backward-paragraph): Update tests.  Add some.

Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
2020-06-13 17:22:48 +02:00
Kyle Meyer aa32f65f83 Rename org-startup-numeroted variable to fix typo
* lisp/org.el (org-startup-numerated): Fix "numeroted" typo in
variable name.
(org-startup-options):
(org-mode):
* doc/org-manual.org (Dynamic Headline Numbering):
(Summary of In-Buffer Settings): Update for rename.

Also fix a few related typos in ORG-NEWS and the manual.

No compatibility alias has been added, as this variable hasn't yet
made it into a release.
2020-06-11 17:55:50 -04:00
Nicolas Goaziou 1aa095ccf1 Fix drawer invisibility
* lisp/org.el (org-cycle-hide-drawers): Move back from "org-compat.el"
(org-cycle-hook):
(org-show-entry):
(org-set-startup-visibility):
(org-clean-visibility-after-subtree-move):
(org-sort-entries): Use `org-cycle-hide-drawers'.
(org-log-beginning):
(org--hide-wrapper-toggle):
(org-hide-drawer-all): Use `outline' invisibility spec for drawers.
(org-show-all): Rewrite taking into account drawers now have the same
invisibility spec as headlines.
(org-overview):
(org-content):
(org-tree-to-indirect-buffer): Use fast arguments for `org-show-all'.
(org-mode): Remove `org-hide-drawer' invisibility spec.
* lisp/org-compat.el (org-flag-drawer): Use `outline' for drawer
invisibility.
(org-cycle-hide-drawers): move back to "org.el".
* lisp/org-clock.el (org-clock-find-position): Use `outline' for
invisibility spec.
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Use
`org-cycle-hide-drawers'.
2020-06-06 17:01:21 +02:00
Nicolas Goaziou b4e379846e Do not insert unwanted TAB characters in some places
* lisp/org.el (org-indent-line): Do not return `noindent'.

Returning `noindent' is not synonymous to "no indentation change
needed".  In particular, `noindent' triggers insertion of
TAB-character, ignoring `tab-always-indent' value.
2020-06-05 14:06:35 +02:00
Bastien Guerry c7a86a43ae Merge branch 'maint' 2020-06-05 10:40:14 +02: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 b68090e0be Another fix to `org-next-visible-heading'
* lisp/org.el (org-next-visible-heading): There is no guarantee that
a `outline' overlay begins on the same line as a headline.
* testing/lisp/test-org.el (test-org/previous-visible-heading): New
test.

Reported-by: Kevin Liu <kevin@nivekuil.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-06/msg00092.html>
2020-06-04 16:08:40 +02:00
Nicolas Goaziou 8483b27c28 Merge branch 'maint' 2020-06-01 22:11:36 +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