Commit Graph

15828 Commits

Author SHA1 Message Date
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
Jack Kamm cc89d5523f ob-python: Fix several issues with :session :results value
* lisp/ob-python.el (org-babel-python-evaluate-session): Fix a few
related issues with :session :results value blocks, including broken
if-else statements, indented blocks with blank lines, and returning
the wrong value when underscore has been used.
(org-babel-python--eval-ast): New constant variable, a string
consisting of Python code to execute a source block using ast.

Previously, python blocks with parameters ":session :results value"
were entered line-by-line into the Python session, which could cause
issues around indentation and new lines.  Now, such python blocks are
written to temp files, then the built-in ast python module is used to
parse and execute them, and to extract the last line separately to
return as a result.  Introduces a change in behavior, requiring that
the last line must be a top-level expression statement if its result
is to be saved (otherwise, the result is None).
2020-02-03 21:17:38 -08:00
Bastien e076ed6e85 Merge branch 'maint' 2020-02-03 21:49:03 +01:00
Bastien cb19f5c94e org-agenda.el: Fix `org-agenda-get-blocks'
* lisp/org-agenda.el (org-agenda-get-blocks): When both dates
are of the same value, assume this is a time to display for
each date in the range.

Thanks to David Masterson for reporting this.
2020-02-03 21:48:06 +01:00
Bastien 917917092d org-table.el: Restore window configuration when debugging formula
* lisp/org-table.el (org-table-eval-formula): Restore window
configuration when debugging table formula is done.

Thanks to Eric Fraga for reporting this.
2020-02-03 20:47:23 +01:00
oldk1331 0eae7a5613 ob-scheme: Handle :epilogue params
Hi all,

This is a simple change that adds support for :epilogue in ob-scheme.

Best wishes,
Qian

==========

* lisp/ob-scheme.el (org-babel-expand-body:scheme): Add :epilogue
  param support.

TINYCHANGE
2020-02-03 20:25:34 +01:00
Bastien 1a29c0eee8 org.el (org-submit-bug-report): Enhance the message
* lisp/org.el (org-submit-bug-report): Enhance the message.
2020-02-03 20:18:57 +01:00
Bastien eace60ad39 Merge branch 'maint' 2020-02-03 18:24:35 +01:00
Bastien 298d633222 org-tempo.el: Fix bug
* lisp/org-tempo.el (org-tempo-add-block): Remove the '>
element of the template to avoid editing the source block
while inserting it through tempo.

Thanks to Ihor and Bram for reporting this and suggesting
the proper fix.
2020-02-03 18:22:55 +01:00
Bastien 77968ce3a3 Revert "org-src.el: Enhance `org-edit-src-code'"
This reverts commit cad2a6a588.
2020-02-03 18:21:26 +01:00
Bastien 7d61bc5bcb org-table.el: Enhance `org-table-set-header-line-format'
* lisp/org-table.el (org-table-set-header-line-format): Use
'line-number face if relevant.
2020-02-03 13:24:34 +01:00
Bastien 5922dab4b9 Merge branch 'maint' 2020-02-03 13:12:05 +01:00
Bastien cad2a6a588 org-src.el: Enhance `org-edit-src-code'
* lisp/org-src.el (org-edit-src-code): Don't throw an error
when trying to find the source language in a non-interactive
call, typically when called for template expansion.

Thanks to Tyler Smith and Jack Kamm for reporting a related bug.
2020-02-03 13:09:34 +01:00
Bastien a557cfcfc6 org-table.el: Fix `org-table-set-header-line-format'
* lisp/org-table.el (org-table-set-header-line-format): Skip
non-data rows correctly.
2020-02-03 10:05:52 +01:00
Bastien 06d36ee60b Silent compiler warning 2020-02-02 20:09:17 +01:00
Bastien 4843030b45 Merge branch 'maint' 2020-02-02 20:08:53 +01:00
Bastien 5c72d60d44 Silent compiler warning 2020-02-02 20:07:18 +01:00
Bastien 9ece54ee64 Merge branch 'maint' 2020-02-02 19:39:40 +01:00
Bastien a2b69c58f8 org-agenda.el: Add `org-agenda-end-of-line'
* lisp/org-agenda.el (org-agenda-mode-map): Remap
'move-end-of-line to 'org-agenda-end-of-line.
(org-agenda-end-of-line): New command.

This fixes this bug: when moving to the end of line, if the next
line is hidden, changing the timestamp of the current headline would
not display the new time. This is also safer when archiving subtrees
and when performing actions on agenda headlines in general.
2020-02-02 19:39:26 +01:00
Bastien 8aa206583b org-agenda.el: Fix `org-agenda-filter-hide-line'
* lisp/org-agenda.el (org-agenda-filter-hide-line):
Temporarily set `buffer-invisibility-spec' to `nil'.
2020-02-02 19:30:25 +01:00
Bastien f7bb9ec9b3 Merge branch 'maint' 2020-02-02 17:38:37 +01:00
Bastien efbf96389a org-agenda.el: Fix display of agenda new time
* lisp/org-agenda.el (org-agenda-show-new-time): Compute the
width relatively to the text scale.
2020-02-02 17:38:09 +01:00
Bastien 34b6b425ed Merge branch 'maint' 2020-02-02 14:04:03 +01:00
Bastien 2a5f879c81 org-table.el: Fix message
* lisp/org-table.el (org-table-toggle-coordinate-overlays):
Fix the message sent when coordinates are not displayed.
2020-02-02 14:03:20 +01:00
Bastien eb5ff71c16 org-table.el: Enhance `org-table-set-header-line-format'
* lisp/org-table.el (org-table-set-header-line-format): Skip
lines setting column widths with <[0-9]+>.

Thanks to Bernard Hugueney for suggesting this.
2020-02-02 12:54:06 +01:00
Bastien d303b6af29 org-table.el: Don't use `if-let' to avoid requiring subr-x.el
* lisp/org-table.el (org-table-row-get-visible-string): Don't
use `if-let' to avoid requiring subr-x.el.
2020-02-01 21:58:28 +01:00
Kisaragi Hiu 4d5731bb33 org.el: Correct docstring
* lisp/org.el (org-effort-property): Correct docstring, as the
previous description of the format was inaccurate.

TINYCHANGE
2020-02-01 17:44:17 +01:00
Bastien 2ba8430b93 Fix previous commit 2020-02-01 17:34:33 +01:00
Bastien fbd8aea6d2 org-table.el: Fixes to `org-table-set-header-line-format'
* lisp/org-table.el (org-table-row-get-visible-string): New
function.
(org-table-set-header-line-format): Use it to handle shrunk
columns.  Also fix handling of `display-line-numbers-mode'.
2020-02-01 17:21:34 +01:00
Bastien 4dcfd7e9db Fix previous commit 2020-02-01 13:18:15 +01:00
Bastien 340bd61777 org-table.el: Check `display-line-numbers-mode' availability
* lisp/org-table.el (org-table-set-header-line-format): Check
whether the `display-line-numbers-mode' command is available.
2020-02-01 13:14:26 +01:00
Jack Kamm dcdb470177 Add inline remote image display
* lisp/org.el (org-display-inline-images): Add inline remote image
display. Remote image display is controlled by the new option
`org-display-remote-inline-images'.
2020-02-01 11:50:08 +01:00
Bastien f704904737 Merge branch 'maint' 2020-02-01 10:16:13 +01:00
No Wayman f33167a0e5 lisp/org-macs.el (org-mks): Respect case
* lisp/org-macs.el (org-mks): Respect case.

This fixes a bug regarding the selection of capture templates.

TINYCHANGE
2020-02-01 10:15:20 +01:00
Bastien 110b034151 Replace "org-table-electric-header" by "org-table-header-line"
* lisp/org-table.el (org-table-header-line-p)
(org-table-header-line-mode): Replace
"org-table-electric-header" by "org-table-header-line".

* doc/org-manual.org (Miscellaneous): Ditto.

Thanks to Samuel Wales for suggesting this name.
2020-02-01 09:52:57 +01:00
Bastien 8651e3ff15 Merge branch 'maint' 2020-02-01 09:45:38 +01:00
Bastien 39c656870c org-agenda.el: Fix handling of one-time delays
* lisp/org-agenda.el (org-agenda-get-scheduled): Fix handling
of one-time delays.

Thanks to hhkg for reporting this.
2020-02-01 09:44:14 +01:00
Bastien c83f889826 org-table.el: Adapt `org-table-set-header-line-format' again
* lisp/org-table.el (org-table-set-header-line-format): Adapt
to `display-line-numbers-mode'.
2020-01-31 21:24:12 +01:00
Bastien fb9eb697d6 org-table.el: Fix `org-table-set-header-line-format' for org-indent-mode
* lisp/org-table.el (org-table-set-header-line-format): When
`org-indent-mode' is turned on, adapt the header's left space
to size of the line prefix.
2020-01-31 21:19:45 +01:00
Bastien 6e944086fb org.el: Tiny formatting fix 2020-01-31 21:17:15 +01:00
Bastien 499cff10ef Merge branch 'maint' 2020-01-31 17:22:01 +01:00
Bastien 04bd110b2b Small fixes
* lisp/ox-odt.el (org-odt--format-timestamp): Fix timestamp
display.

* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Remove
useless code.
2020-01-31 17:21:43 +01:00
Bastien 5e9c3c0794 org.el: Enhance docstrings
* lisp/org.el (org-get-priority)
(org-priority-get-priority-function): Enhance docstring.
2020-01-31 17:12:46 +01:00
Bastien 3d0282ef87 New option `org-archive-subtree-save-file-p'
* lisp/org-agenda.el (org-agenda-archive-with): Bind
`org-archive-from-agenda' to `t' when archiving from agenda.

* lisp/org-archive.el (org-archive-subtree-save-file-p): New option.
(org-archive-subtree): Use the new option.

* doc/org-manual.org (Moving a tree to an archive file):
Mention the new option.

Thanks to Russ Allbery for suggesting a similar idea.
2020-01-31 10:42:40 +01:00
Bastien c9d2f12094 org-agenda.el: Use `user-error'
* lisp/org-agenda.el (org-agenda-priority): Use `user-error'.
2020-01-31 08:36:00 +01:00
Bastien 4f98694bf7 Allow numeric values for priorities
* lisp/org.el (org-priority-highest, org-priority-default):
Allow integer.
(org-priority-get-priority-function): Tiny docstring change.
(org-priority-to-value): New defsubst.
(org--setup-collect-keywords, org-priority-regexp)
(org-priority, org-get-priority): Allow numeric values.

* doc/org-manual.org (Priorities): Illustrate the use of
numeric values for priorities.
2020-01-30 23:01:29 +01:00
Bastien 3942ccec87 ob-screen.el: Silence compiler warning
* lisp/ob-screen.el (org-babel-screen-test): Use `message'.
2020-01-30 18:29:26 +01:00
Bastien 11734ba22a Merge branch 'maint' 2020-01-30 15:41:22 +01:00
Bastien 1d97b730d2 Delete unused variable 2020-01-30 15:40:22 +01:00
Bastien e11f506484 Continue previous commit and document it in etc/ORG-NEWS
* lisp/org.el (org-priority-enable-commands)
(org-priority-highest, org-priority-get-priority-function):
Define aliases.

(org-priority): Use `org-priority-show'.

* lisp/org-agenda.el (org-agenda-priority, org-agenda-menu):
Ditto.
2020-01-30 15:16:44 +01:00
Bastien 1de5e80adf Rename `org-x-priority' functions and variables to `org-priority-x'
* lisp/org.el (org-priority-enable-commands)
(org-priority-start-cycle-with-default)
(org-set-regexps-and-options, org-sort-entries, org-priority)
(org-get-priority, org-entry-properties)
(org-property-get-allowed-values, org-shiftup, org-shiftdown):
Rename `org-[x]-priority' functions and variables to
`org-priority-[x]'.

* lisp/org-pcomplete.el (org-priority-default)
(org-priority-highest)
(pcomplete/org-mode/file-option/priorities): Ditto.

* lisp/org-mouse.el (org-mouse-get-priority)
(org-mouse-priority-list): Ditto.

* lisp/org-agenda.el (org-agenda-fontify-priorities)
(org-agenda-format-item, org-agenda-priority): Ditto.

* lisp/ox-icalendar.el (org-icalendar--vtodo): Ditto.

* doc/org-manual.org (Priorities, Summary of In-Buffer Settings): Ditto.

* testing/lisp/test-org.el (test-org/set-regexps-and-options)
(test-org/entry-properties): Ditto.
2020-01-30 14:56:38 +01:00
Bastien 7b1077def7 Tiny enhancements to priority handling
* lisp/org.el (org-font-lock-add-priority-faces): Use
`org-priority-regexp'.
(org-priority-regexp): Match multiple characters.

* lisp/org-agenda.el (org-agenda-fontify-priorities): Use
`org-priority-regexp'.

This commit paves the way for more flexibility in priority handling.
For example, `org-priority-[up/down]' could deal with priorities as
numbers (e.g. [#1]) instead of letters.
2020-01-30 12:05:07 +01:00
Bastien 759c1567b1 org-table.el: Silence compiler warnings 2020-01-30 11:54:51 +01:00
Bastien 8c943b8403 org-agenda.el: Don't always display a message when removing filters
* lisp/org-agenda.el (org-agenda-filter-remove-all): Only display
a message when called interactively.
2020-01-30 10:24:42 +01:00
Bastien 9fe7dbfd15 org-agenda.el: Small `org-agenda-filter' enhancement
* lisp/org-agenda.el (org-agenda-filter): Use existing filters as
the initial prompt input.
2020-01-29 22:12:55 +01:00
Bastien a7770e6333 Merge branch 'maint' 2020-01-29 21:49:22 +01:00
Bastien 2820c2c4aa org-agenda.el: Minor fixes
* lisp/org-agenda.el (org-agenda-filter): Tiny formatting fix.
(org-agenda-filter-completion-function): Fix docstring typo.
2020-01-29 21:48:58 +01:00
Bastien db3758da92 Merge branch 'maint' 2020-01-29 21:44:05 +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 0aff90f499 Run `org-table-electric-header-mode' with a tiny timer
* lisp/org-table.el (org-table-electric-header-mode): Autoload and
run with timer.
2020-01-29 21:35:04 +01:00
Bastien 57721a1cb0 Handle header line scaling for `org-table-electric-header-mode'
* lisp/org-table.el (org-table-temp-header-remapping): New variable.
(org-table-set-header-line-format): Scale the header line properly.
(org-table-electric-header-mode): Don't run outside `org-mode'.
2020-01-29 17:14:12 +01:00
Bastien b476ffd266 Implement the `org-table-electric-header-mode' minor mode
* lisp/org-table.el (org-table-electric-header-p): New option.
(org-table-temp-header-line, org-table-electric-header-mode): New
variables.
(org-table-set-header-line-format)
(org-table-electric-header-mode): New minor mode to display the
table's current first row as the header line when this first row
is not visible anymore.

* doc/org-manual.org (Miscellaneous): Document
`org-table-electric-header-mode'.
2020-01-29 15:17:32 +01:00
Bastien 0f86a14af3 Silence compiler warning 2020-01-29 15:10:19 +01:00
Bastien 70ef811001 Silence compiler warning 2020-01-29 15:08:33 +01:00
Bastien 241750b3c2 Use `number-to-string' instead of `int-to-string'
* lisp/org.el (org-end-of-subtree): Use `number-to-string' instead
of `int-to-string'.

* lisp/org-table.el (org-table-edit-field)
(org-table-fix-formulas, org-table-analyze, orgtbl-make-binding)
(org-table-field-info): Ditto.

* lisp/org-macs.el (org-shorten-string): Ditto.

* lisp/org-agenda.el (org-get-time-of-day): Ditto.
2020-01-28 20:19:24 +01:00
Bastien e9526b5a79 Enhance C-c C-c in agenda buffers
* lisp/org-agenda.el (org-agenda-ctrl-c-ctrl-c): Don't try to
deactivate columns as `org-columns-toggle-or-columns-quit' is
already bound to `C-c C-c' when the column view is active.

* lisp/org.el (org-ctrl-c-ctrl-c): Update docstring.
2020-01-28 12:44:27 +01:00
Marco Wahl 82ebc73b92 agenda: Refactor key defining section towards more consitency
Unify spaces and use the function quote.
2020-01-28 09:53:15 +01:00
Marco Wahl be0865603a Merge remote-tracking branch 'origin/master' 2020-01-28 09:38:08 +01:00
Kyle Meyer 95a91df825 org-clock: Fix typos in org-show-notification-timeout's docstring
* lisp/org-clock.el (org-show-notification-timeout): Fix docstring
typos.
2020-01-27 23:25:37 -05:00
Marco Wahl 4a43cd983b agenda: Refactor use uniform key definition 2020-01-28 00:38:51 +01:00
Marco Wahl 45a0fe531c agenda: C-c C-c deactivates columns
* lisp/org-agenda.el (org-agenda-ctrl-c-ctrl-c):  New function.

This is to unify and thereby harmonize the behavior of C-c C-c with
regard to Org files and columns.
2020-01-28 00:00:05 +01:00
Marco Wahl b3d1e54877 Merge remote-tracking branch 'origin/master' 2020-01-27 23:46:10 +01:00
Bastien 32eba0f0a6 Merge branch 'maint' 2020-01-27 23:41:56 +01:00
Marco Wahl 1e55b18198 org-colview: Fix org-agenda-columns-active
* lisp/org-colview.el (org-agenda-columns): Set
  org-agenda-columns-active when columns get activated.
2020-01-27 23:39:25 +01:00
Marco Wahl 42ad656436 org: Extend documentation some
* lisp/org.el (org-ctrl-c-ctrl-c): Document more cases.
2020-01-27 23:35:47 +01:00
Bastien 6d0b866637 org-agenda.el: Fix 1f6bacf88 properly
* lisp/org-agenda.el (org-agenda-mode): Make `text-scale-mode' usable
before any call to `org-agenda-redo'.
2020-01-27 18:42:11 +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 53acdfaa03 Revert "org-agenda.el: don't prevent the use of M-x text-scale-mode RET"
This reverts commit 1f6bacf88c.
2020-01-27 16:10:24 +01:00
Bastien 3b87d4ab4f Fix compiler warning
* lisp/org-clock.el (w32-notification-notify): Declare.
2020-01-27 15:17:42 +01:00
Bastien 6f02fa596a Merge branch 'maint' 2020-01-27 14:55:50 +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 8a12b125a8 org.el: New default value for `org-file-apps'
* lisp/org.el (org-file-apps): Add emacs as the application for
opening directories.
2020-01-26 19:33:53 +01:00
Bastien f603039884 Merge branch 'maint' 2020-01-26 19:16:18 +01:00
Bastien 47b1042c4c org-attach.el: Tiny formatting fix
* lisp/org-attach.el (org-attach-attach): Tiny formatting fix.
2020-01-26 19:16:01 +01:00
Bastien 933a9ee993 org-attach.el: Enhance dispatch buffer navigation
* lisp/org-attach.el (org-attach): Enhance dispatch buffer
navigation.

Thanks to Vladimir Nikishkin for raising this issue.
2020-01-26 19:05:08 +01:00
Bastien 081d571a3d org.el: Use `user-error' in `org-back-to-heading'
* lisp/org.el (org-back-to-heading): Use `user-error'.
2020-01-26 17:50:27 +01:00
Bastien f9c34a7d51 org-clock.el: New option `org-show-notification-timeout'
* lisp/org-clock.el (org-show-notification-timeout): New option.
(org-show-notification): Use `w32-notification-notify' and the new
option.
2020-01-26 17:35:18 +01:00
Bastien b6fc8396a6 Merge branch 'maint' 2020-01-26 17:03:21 +01:00
Bastien a3c373a1bf org-clock.el: Explicitely require 'notifications
* lisp/org-clock.el (org-show-notification): Explicitely require
'notifications and remove w32-related code.
2020-01-26 16:49:11 +01:00
Bastien 389875c495 Merge branch 'maint' 2020-01-26 16:33:29 +01:00
Bastien 3399918691 Add maintainer 2020-01-26 12:59:55 +01:00
Bastien 360c8225ff Add maintainer 2020-01-26 12:59:23 +01:00
Bastien 3b3d577ee7 Add maintainer
(Continue testing post-receive hook.)
2020-01-26 12:57:53 +01:00
Bastien f828a27323 Adding maintainer
(Testing post-receive hook.)
2020-01-26 12:07:01 +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 1f52f8c502 org-agenda.el: Adding maintainer
(Testing post-receive hook.)
2020-01-26 12:03:29 +01:00
Bastien bd1d449e7f Add maintainer information
(Testing the new post-receive hook.)
2020-01-26 12:01:29 +01:00
Bastien 91aef7219b Merge branch 'maint' 2020-01-26 11:06:11 +01:00
Bastien 1d426e4a59 Bump version number to 9.3.2 2020-01-26 11:05:20 +01:00
Nicolas Goaziou 4141355492 Merge branch 'maint' 2020-01-26 09:45:28 +01:00
Edward Sillador 8dd2984a94 org-clock.el: Handle notification on windows-nt
* lisp/org-clock.el (org-show-notification): Handle notification
on windows-nt.

TINYCHANGE
2020-01-26 09:09:02 +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 1f6bacf88c org-agenda.el: don't prevent the use of M-x text-scale-mode RET
* lisp/org-agenda.el (org-agenda-mode): Fix bug: don't prevent the
use of M-x text-scale-mode RET.

Before this fix, M-x text-scale-mode RET was only available after
the agenda buffer was redone once.  Now it is available immediately.

This fixes commit 00c1184a0.
2020-01-25 21:01:32 +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
Bastien e19eea48a5 org-clock.el: Use `user-error' instead of `error'
* lisp/org-clock.el (org-clock-cancel, org-clock-goto)
(org-clocktable-shift, org-dblock-write:clocktable)
(org-clocktable-write-default): Use `user-error' instead of
`error'.
2020-01-25 20:19:19 +01:00
Bastien 7f1b51b615 Fix previous commit 2020-01-25 19:46:35 +01:00
Bastien 32f00fe90e org.el: Remove variables, small refactoring
* lisp/org.el (org-get-level-face): Remove variables, small
refactoring.

Thanks to Jorge P. de Morais Neto for pointing to this.
2020-01-25 19:23:34 +01:00
Bastien ea6349d671 org.el: Delete dynamically scoped variable
*  (org-dcst): Delete dynamically scoped variable.
2020-01-25 19:16:49 +01:00
Jack Kamm cd1014a75a org-src: Add call to quit-restore-window in org-src-switch-to-buffer
* lisp/org-src.el (org-src-switch-to-buffer): Add call to
quit-restore-window in org-src-switch-to-buffer when
org-src-window-setup is other-window so that the popped up window is
closed on exit.
2020-01-24 23:12:22 -05:00
Jack Kamm 7d5e931f79 org-src: Add option `plain' to org-src-window-setup
* lisp/org-src.el (org-src-window-setup): Add option `plain' for
org-src-window-setup, that uses vanilla display-buffer to show the
source window.
2020-01-24 23:06:40 -05:00
Bastien dc1d4aa12e Merge branch 'maint' 2020-01-20 16:58:00 +01:00
Bastien 06cf532f47 org-agenda.el: Fix bug when using category filters
* lisp/org-agenda.el (org-agenda-filter-make-matcher): Use `or'
for category filters, `and' for other filters.

For example, when using `org-agenda-category-filter-preset' set to
'("+cat1" "+cat2"), using `and' in the filter matcher results in
displaying 0 headline, since no headline can have two categories.
2020-01-20 16:51:36 +01:00
Gustav Wikström edefb2835d Additional option for org-attach-store-link-p
* doc/org-manual.org (Attachment options)
* etc/ORG-NEWS (New option in ~org-attach-store-link-p~)
* lisp/org-attach.el (org-attach-store-link-p)
  (org-attach-attach): Add option to store a link to the attached file
  with a file link.
2020-01-19 10:50:14 +01:00
Gustav Wikström f0ce4a6357 org-attach: variable name change
* lisp/org-attach.el (org-attach-attach): Change variable name only
  for the point of better semantics
2020-01-19 10:50:14 +01:00
Gustav Wikström a632873ad9 Mention the new contextual property set for attachment links
* lisp/org-element.el (org-element-link-parser): Mention
  :attachment-path in docstring.
2020-01-18 01:56:27 +01:00
Gustav Wikström 52fafd3005 Fix backtick in org-odt-inline-image-rules
* lisp/ox-odt.el (org-odt-inline-image-rules): Fix error to make the
  list evaluate inline code at definition.
2020-01-18 01:41:16 +01:00
Gustav Wikström 20d293b4aa Give link parser knowledge of attachment link expanded path
* lisp/org-element.el (org-element-link-parser): Add info about
  expanded attachment paths to the link parse tree export.

* lisp/org-attach.el Remove org-attach-open-link.  Let attachment
  links use the built in code that already is developed for file
  links.

* lisp/ol.el (org-link-open): Add knowledge about attachment links to
  the function opening links, so they can be opened exactly as file
  links are opened.

* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Refactor to use property from
  link parser instead of invoking attachment expansion in the
  exporter.
2020-01-18 01:41:01 +01:00
Jack Kamm d833920def org-src: restore windows for some values of org-src-window-setup 2020-01-16 16:09:42 +01:00
Gustav Wikström f93020d5e6 Expand attachment links with point in correct place
* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Move point to the link for
  org-attach-expand to know from which headline to expand the link.
2020-01-15 20:40:24 +01:00
Gustav Wikström 0ac6a9e1fc Further fix of exporting attachment links in export backends
* lisp/ox-html.el (org-html-link, org-html-inline-image-rules)
* lisp/ox-odt.el (org-odt-inline-image-rules)
* lisp/ox-texinfo.el (org-texinfo-link)
  (org-texinfo-inline-image-rules): Make attachment links consistently
  expand as relative to file and add attachment link type to
  image rules for consistency among export backends.
2020-01-14 21:45:31 +01:00
Gustav Wikström d70db54dbc Improve attachment link export functionality
Make attachment links export just as file links.

* lisp/ox-ascii.el
* lisp/ox-html.el
* lisp/ox-latex.el
* lisp/ox-man.el
* lisp/ox-md.el
* lisp/ox-texinfo.el
* lisp/org-attach.el: Move export functionality for attachment links
  into the respective export backend, for feature parity with file
  links.
2020-01-14 04:15:38 +01:00
Gustav Wikström 32aa7139fd Markdown exporter: restructure org-md-link
* lisp/ox-md.el (org-md-link): Restructure slightly to match the code
  structure of other exporters.  For easier later refactor.
2020-01-14 04:07:55 +01:00
Nicolas Goaziou c1aed9f809 ob-core: Refactor `org-babel-expand-noweb-references'
* lisp/ob-core.el (org-babel-expand-noweb-references): Refactor code.
Improve cache handling.
2020-01-12 11:38:04 +01:00
Nicolas Goaziou 3999320aa4 Merge branch 'maint' 2020-01-11 20:18:47 +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 b1822760f4 Fix exporting visible parts of a buffer
* lisp/org-element.el (org-element--parse-elements): Only ignore parts
due to folding, not because of fontification.
* lisp/org-macs.el (org-invisible-p): Add an optional argument.
* testing/lisp/test-org-element.el (test-org-element/parse-buffer-visible):
Add tests.
2020-01-11 20:13:39 +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
Nicolas Goaziou 894189fa72 ob-core: Optimize multiple :noweb-ref expansions in a source block
* lisp/ob-core.el (org-babel-expand-noweb-references): Optimize
multiple :noweb-ref expansions in a source block.
2020-01-08 23:08:47 +01:00
Nicolas Goaziou 2fde90aa2e org-duration: Read and write duration in compact form
* lisp/org-duration.el (org-duration-format): Add `compact' symbol.
(org-duration-set-regexps): Make white space between duration parts
optional
(org-duration-from-minutes): Handle `compact' symbol.
* testing/lisp/test-org-duration.el (test-org-duration/from-minutes):
(test-org-duration/p): Add tests.
2020-01-04 18:39:05 +01:00
Nicolas Goaziou 2fbbc23368 Fix build
* lisp/org-compat.el (org-file-properties): Prevent error at build
time about creating an alias for a local variable.
* lisp/org.el (org-keyword-properties): Slight change to docstring.
2020-01-03 11:07:28 +01:00
Kyle Meyer 93c11da002 Merge branch 'maint' 2020-01-01 13:39:26 -05:00
Kyle Meyer ff5fc050d3 Update copyright year to 2020 2020-01-01 13:38:46 -05:00
Nicolas Goaziou 09df149991 Merge branch 'maint' 2019-12-31 16:56:45 +01:00
Nicolas Goaziou f37ae5e56a Small refactoring
* lisp/org.el (org-kill-note-or-show-branches): Prefer `org' functions
over `outline' ones.  Use `cond' instead of nested `if'.
2019-12-31 16:55:48 +01:00
Marco Wahl c637195e45 Merge branch 'maint' 2019-12-31 13:58:26 +01:00
Marco Wahl 524ccf3adb org: Fix: keep archived subtrees hidden after C-c C-k
* lisp/org.el (org-kill-note-or-show-branches): Hide archived
subtrees.

Report by Allen Li
https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00396.html
2019-12-31 13:55:12 +01:00
Marco Wahl bcf1187baf Merge branch 'maint' 2019-12-31 12:43:32 +01:00
Marco Wahl c0c790eb9b org: Fix use of image-map for inline images
Don't set image-map for Emacs before v26.  Variable image-map
available with emacs-version 26.

Reported by Johannes Brauer
https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00391.html
2019-12-31 12:38:04 +01:00
Jarmo Hurri ac939125a4 ob-java: Add header argument to pass command line args
* lisp/ob-java.el (org-babel-execute:java): Handle new header argument `:cmdargs` and pass its value as the last element in call to java.
2019-12-27 09:56:11 +01:00
Bastien 747c6a8b55 Bump version number to 9.3.1 2019-12-26 19:16:10 +01:00
Bastien b23b6a4abd org.el: Bump version keyword to "9.4-dev" 2019-12-24 11:53:38 +01:00
Bastien 28b9435ade Remove version keywords from Org libraries 2019-12-24 11:51:58 +01:00
Terje Larsen 2dddaf474b org: Add customization to fontify TODO headlines
* lisp/org.el (org-fontify-todo-headline): Add new boolean customization to
  toggle this behavior.
* lisp/org.el (org-set-font-lock-defaults): Apply face org-headline-todo to
  lines starting with keywords in org-not-done-keywords.
* lisp/org-faces (org-headline-todo): New face.

TINYCHANGE
2019-12-22 16:00:39 +01:00
Nicolas Goaziou 83627a145b Merge branch 'maint' 2019-12-22 15:14:22 +01:00
Thomas Fitzsimmons b47e0c8bfa org-agenda: Fix time regexp in org-get-entries-from-diary
* lisp/org-agenda.el (org-get-entries-from-diary): Make time regular
expression more precise.

Reported-by: Justin Abrahms <justin@abrah.ms>
2019-12-22 15:14:04 +01:00
Nicolas Goaziou 2eeafcaf34 Merge branch 'maint' 2019-12-22 14:58:14 +01:00
Nicolas Goaziou 546cbad531 Link syntax require to escape every square bracket
* lisp/ol.el (org-link-make-regexps): Update regexp to forbid any
un-escaped square bracket in the URI.
(org-link-escape):
(org-link-unescape):
* testing/lisp/test-ol.el (test-ol/escape):
(test-ol/unescape):
(test-ol/store-link):
* testing/lisp/test-org.el (test-org/custom-id):
(test-org/fuzzy-links):
* testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link): Adapt
to new syntax.
* doc/org-manual.org (Link Format): Update documentation.

The new syntax allowed un-escaped opening square brackets in the URI
part of bracket links. Unfortunately, it led to bug as described here:

  <https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00312.html>

Now, we require to escape every square bracket in the URI.
2019-12-22 14:52:53 +01:00
Nicolas Goaziou 32641117a5 Merge branch 'maint' 2019-12-22 10:08:30 +01:00
nixo 6315e1e760 ox-odt: Get write permissions on styles.xml
* lisp/ox-odt.el (org-odt-template): The file `styles.xml' might be
copied from a location where it is read-only.  Since we need to modify
it (and its copied under /tmp, so we can modify it), we need to ensure
we have write persmissions on it.  Set mode to 600.

This is especially needed for projects like Guix, where all system
files are stored in a read-only location.

TINYCHANGE
2019-12-22 10:07:29 +01:00
Nicolas Goaziou 7fe3605d9c Merge branch 'maint' 2019-12-19 14:07:58 +01:00
Tom Gillespie 04d2828ad9 org: Fix verbatim block fontification to end blocks on headlines
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Enhance regex
for finding the end of blocks (i.e., `beg-of-endline') to detect
headlines (i.e., (rx bol (one-or-more "*") space) so that fontification
matches the behavior of org mode (i.e., that headlines are healines,
even in vertabim).

This change aligns the behavior and the visual appearance of verbatim
blocks that contain headlines. When `font-lock-mode' is enabled this
change makes situations like those in (info "(org) Literal Examples")
literally jump off the page.

Overview of new fontification

Source                | fontification before | fontification after  |
\#+BEGIN_EXAMPLE      | org-block-begin-line | org-block-begin-line |
I look verbatim!      | org-block            | org-block            |
* Org headers in      | org-block            | org-level-1          |
verbatim blocks       | org-block            | nil                  |
** highly accordingly | org-block            | org-level-2          |
\#+END_EXAMPLE        | org-block-end-line   | org-meta-line        |

This commit also makes some improvements to the reability of
org-fontify-meta-lines-and-blocks-1.

1. Use the `rx' macro for better readability. Note that the strings
below return with literal tabs when using `rx'. Expansion included for
reference here.

Begin regex.
old: "^\\([ \t]*#\\(\\(\\+[a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)[ \t]*\\(\\([^ \t\n]*\\)[ \t]*\\(.*\\)\\)\\)"
new: "^\\([[:blank:]]*#\\(\\(\\+[A-Za-z]+:?\\|[[:space:]]\\|$\\)\\(_\\([A-Za-z]+\\)\\)?\\)[[:blank:]]*\\(\\([^	\n ]*\\)[[:blank:]]*\\(.*\\)\\)\\)"

End regex. Note match-string call is stringified for documentation here.
old:                        (concat "^[ \t]*#\\+end" (match-string 4) "\\>.*")
new: "\\(?:\\(^\\(?:\\*+[[:space:]]\\|[[:blank:]]*#\\+end(match-string 4)\\>.*\\)\\)\\)"

Caption regex:
old: "\\([ \t]*#\\+caption\\(?:\\[.*\\]\\)?:\\)[ \t]*"
new: "\\([[:blank:]]*#\\+caption\\(?:\\[.*]\\)?:\\)[[:blank:]]*"

2. Refactor fontification of #+end blocks for readability and to reduce
the number of calls to point-max to one per branch.

TINYCHANGE
2019-12-19 14:07:33 +01:00
Nicolas Goaziou 0a82c8370d org-attach: Tiny refactoring
* lisp/org-attach.el (org-attach): Use `org-with-point-at'.
2019-12-15 19:08:07 +01:00
Nicolas Goaziou 1d38233b83 Silence byte-compiler
* lisp/org-compat.el (org-file-properties): Fix typo.
2019-12-15 19:07:51 +01:00
Nicolas Goaziou c539ecb51f Merge branch 'maint' 2019-12-15 14:21:54 +01:00
Nicolas Goaziou 52fea37b02 org-list: Remove unused defvar 2019-12-15 14:21:34 +01:00
Nicolas Goaziou ee2a8eb241 org-element: Forbid affiliated keywords for comments
* lisp/org-element.el (org-element--current-element): Forbid
affiliated keywords for comments.
* testing/lisp/test-org-element.el (test-org-element/comment-parser):
Tiny refactoring.

The motivation is to avoid distinguishing between top-level comments,
which cannot have affiliated keywords, and other comments, which
could.  Therefore, we keep a single type of comment.
2019-12-15 14:06:20 +01:00
Nicolas Goaziou af99544286 org-element: Fix top-level property-drawer parsing
* lisp/org-element.el (org-element-comment-parser): Top level comments
do not have affiliated keywords.
(org-element--current-element): Properly parse top-level comments and
top-level properties drawer.
(org-element--next-mode): Change signature.
(org-element--parse-elements): Apply signature change.
(org-element--parse-to): Apply signature change.  Look for top-level
comments or properties drawer.
* testing/lisp/test-org-element.el (test-org-element/property-drawer-parser):
Add comment.

Initially, `org-element--current-element' would defer to
`org-get-property-block' to validate a property-drawer, which is the
wrong way to look at the low-level Org Element library. Also, it would
allow affiliated keywords, which is not possible.
2019-12-15 13:34:30 +01:00
Nicolas Goaziou 4f398cf84e Merge branch 'maint' 2019-12-15 10:02:57 +01:00
Matt Huszagh bc9a92ee7b org: Remove leading/trailing whitespace from latex fragment
* lisp/org.el (org-create-formula-image): Ensure user input ends
with a % character to remove trailing whitespace. Also, add %
characters between macros and newlines purely visual.

TINYCHANGE
2019-12-15 10:02:38 +01:00
Gustav Wikström 26ace90042 Make org-attach store links using attachment-links
* lisp/org-attach.el (org-attach-attach): Storing links using the new
  attachment link type instead of file links.

* lisp/org-compat.el (org-attach-store-link, org-attach-expand-link):
  Remove not needed functions and mark them as obsolete for easier
  future reference.
2019-12-13 23:01:10 +01:00
Nicolas Goaziou 31d2f48f69 Merge branch 'maint' 2019-12-12 22:35:10 +01:00
Nicolas Goaziou b64a3308aa org-capture: Get capture templates from anonymous functions
* lisp/org-capture.el (org-capture-get-template): Allow specifying
template from an anonymous function.
* doc/org-manual.org (Template elements): Document it.
2019-12-12 22:33:22 +01:00
Kyle Meyer 955e531d24 Merge branch 'maint' 2019-12-11 21:24:45 -05:00
Paul Eggert f9a55cba31 Backport commit b0f20651e from Emacs
; Spelling fixes
b0f20651e3cbb8a66f11ffae4c18634019c20cd4
Paul Eggert
Tue Dec 10 20:05:49 2019 -0800
2019-12-11 21:22:50 -05:00
Paul Eggert ac90e86c32 Backport commit d1a791f8e from Emacs
Spelling fixes
d1a791f8edc1b8f2189b6f1b3be7b946fef1edbc
Paul Eggert
Mon Dec 9 18:45:18 2019 -0800
2019-12-11 21:19:55 -05:00
Marco Wahl 348e607889 agenda: Make the non-hd lines applicable for filters
Remark: Examples for non-hd lines are "Diary lines" and "Anniv lines".
2019-12-09 23:21:34 +01:00
Nicolas Goaziou 2f9188658b org-capture: Silence byte-compiler
* lisp/org-capture.el (org-capture-set-target-location): Fix pcase
patterns.
2019-12-09 22:14:01 +01:00
Nicolas Goaziou 1c4a3c4f69 Merge branch 'maint' 2019-12-09 21:31:52 +01:00
Thibault Marin 91def2a211 ox-html: Add equation numbers only for numbered environments
* lisp/ox-html.el (org-html-latex-environment): Add caption to
numbered environments only
(org-html--latex-environment-numbered-p): New function.
2019-12-09 21:29:56 +01:00
Jason Dunsmore a410413be8 org-capture: Add support for month trees
* doc/org-manual.org: Add `:tree-type month' option for capture
  templates.
* lisp/org-capture.el (org-capture-set-target-location): Add
  `:tree-type month' option to capture templates to group entries by
  month.
* lisp/org-datetree.el (org-datetree-find-month-create): Add
  `org-datetree-find-month-create' function to add datetree entries
  grouped by month.
* testing/lisp/test-org-datetree.el
  (test-org-datetree/find-month-create): Add test for new function.
2019-12-09 20:08:28 +01:00
Kyle Meyer 5f2247f2fe Merge branch 'maint' 2019-12-09 05:34:03 -05:00
Takaaki ISHIKAWA c7ad3f8845 ox.el: Replace error with user-error to exit org-export-dispatch
* lisp/ox.el (org-export--dispatch-action): Replace error with
user-error a user-error so that user can quit `org-export-dispatch'
without entering debugging mode.

Modified from a patch proposal by Takaaki Ishikawa.
<https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00071.html>
2019-12-09 05:33:00 -05:00
Nicolas Goaziou be743450c9 Merge branch 'maint' 2019-12-07 12:31:46 +01:00
Nicolas Goaziou eab7c4e581 ox-latex: Fix output for Tikz or PGF images
* lisp/ox-latex.el (org-latex--inline-image): Fix output for Tikz or
PGF images.
2019-12-07 12:30:19 +01:00
Kyle Meyer 2eee3ca190 Merge branch 'maint' 2019-12-05 23:00:03 -05:00
Kyle Meyer 2ab4540b98 Update customize-package-emacs-version-alist
* lisp/org.el (customize-package-emacs-version-alist): Map Org 9.3 to
Emacs 27.1.
2019-12-05 22:59:53 -05:00
Paul Eggert a3101370bd Backport commit 4c9330771 from Emacs
* lisp/org-agenda.el (org-agenda-filter): Fix unescaped literal ‘+’ in
regexp.  Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00215.html
* lisp/org.el (org-clone-subtree-with-time-shift): Fix a regexp typo
that mishandled strings like ‘\1d’, reported by the same email.

2019-12-05 regexp lint fixes
4c933077157ba409d645f4649c8a3a8e534d53d5
Paul Eggert
Thu Dec 5 19:32:12 2019 -0800
2019-12-05 22:59:06 -05:00
Bastien bb61b37ee2 ol.el: Don't store the same link twice
* lisp/ol.el (org-store-link): Don't store the same link twice.
2019-12-05 17:11:26 +01:00
Bastien 0997eba287 org-agenda.el: Warn the user when removing all agenda filters
* lisp/org-agenda.el (org-agenda-filter-remove-all): Warn the user.
2019-12-05 17:04:02 +01:00
Bastien 7938b6ec30 org.el: Fix warning when updating to the same TODO state
*  (org-todo): Only warn about TODO state change when both new and
old states are not `nil'.
2019-12-05 16:57:37 +01:00
Bastien 0ff2867aa1 org.el: Warn the user when buffer is (un)narrowed to subtree
* lisp/org.el (org-toggle-narrow-to-subtree): Warn the user when
buffer is (un)narrowed to subtree.
2019-12-05 16:51:25 +01:00
Kyle Meyer 5d932fe045 Merge branch 'maint' 2019-12-04 21:20:33 -05:00
Paul Eggert 9c5174e235 Backport commit ab612302b from Emacs
* lisp/org-table.el (org-table-wrap-region): Avoid
repetition-of-repetition in regexp.

Fix regex repetition of repetitions
ab612302b4917fec5846922f3d8ffafa673c0d36
Paul Eggert
Wed Dec 4 16:54:24 2019 -0800
2019-12-04 21:19:51 -05:00
Marco Wahl b8f43ecbf4 org,colview: Quit column-view with C-c C-c. manual,news: Update
* lisp/org-colview.el (org-columns-toggle-or-columns-quit): New
  function.  Takes the place of removed function
  org-columns-set-tags-or-toggle.
2019-12-04 23:36:33 +01:00
Nicolas Goaziou fe2db1ee8f Merge branch 'maint' 2019-12-04 18:46:44 +01:00
Nicolas Goaziou 18ddc64362 ob-plantuml: Fix typo
* lisp/ob-plantuml.el (org-babel-plantuml-make-body): Fix typo.
2019-12-04 18:45:18 +01:00
Bastien 46319b5f69 Backport commit 8fb773cc91 from Emacs 2019-12-04 10:37:19 +01:00
Kyle Meyer 12e87f46a1 Merge branch 'maint' 2019-12-03 21:55:00 -05:00
Kyle Meyer 8cd225a36c Clean up spacing to pass Emacs's pre-commit check 2019-12-03 21:46:54 -05:00
Kyle Meyer ce6c4adb24 Merge branch 'maint' 2019-12-03 21:22:57 -05:00
Glenn Morris f4d8622bc6 Backport commit 94c5eeb1f from Emacs
; Fix copyright years and license notices for recent org files
94c5eeb1fd33b043f68c4021fa0aed0e5590763e
Glenn Morris
Tue Dec 3 17:19:14 2019 -0800
2019-12-03 21:22:42 -05:00
Marco Wahl cb8183d3b7 agenda: Refactor a little
* lisp/org-agenda.el (org-agenda-filter-apply): Simplyfy some.
2019-12-03 12:10:45 +01:00
Marco Wahl 0ce8d372b0 Merge branch 'master' into next 2019-12-03 11:49:16 +01:00
Marco Wahl 3342e26f32 Merge branch 'maint' 2019-12-03 11:45:42 +01:00
Marco Wahl 804e6af51c agenda: Fix filter for day/week agenda
* lisp/org-agenda.el (org-agenda-filter-apply): Use the org-hd-marker
  to identify headlines instead of org-marker.
2019-12-03 11:42:54 +01:00
Kyle Meyer aeaaf39381 Merge branch 'master' into next 2019-12-01 21:32:43 -05:00
Kyle Meyer ad171650bb Merge branch 'maint' 2019-12-01 21:29:35 -05:00
Stefan Monnier f2d03cb6b4 Backport commit 5bc97ebce from Emacs
* lisp/org.el (org-mode): Add pcomplete-completions-at-point to capf.

This lets the normal `completion-at-point` and `complete-symbol`
use `pcomplete` for completion.

(org-mode-map): Leave M-TAB bound to the global default since
`pcomplete` is now obsolete.

5bc97ebceb54e0eb2804bef4c1bc32a40d8a2371
Stefan Monnier
Mon Nov 18 17:47:06 2019 -0500
2019-12-01 21:28:39 -05:00
Marco Wahl 8ded89cc38 Merge branch 'master' into next 2019-11-26 22:45:10 +01:00
Marco Wahl be7e88ae30 agenda: Fix: Don't loop over headlines in region at agenda-todo
* lisp/org-agenda.el (org-agenda-todo): Set the respective variable to
  nil.
2019-11-26 22:33:45 +01:00
Sebastian Miele 0e70e2a42b ob-core: Respect COMMENTed headlines when expanding noweb references
* lisp/ob-core.el (org-babel-expand-noweb-references): Add calls to
org-in-commented-heading-p where appropriate.
2019-11-24 10:27:35 +01:00
Marco Wahl be81ee46ba Merge branch 'master' into next 2019-11-22 11:33:54 +01:00
Marco Wahl 43c086f4f7 org: restrict inline image display to narrowed part
* lisp/org.el (org-display-inline-images): Clarify documentation and
  introduce the narrowing borders to the function.
2019-11-22 11:29:26 +01:00
Sebastian Miele 3649d95b13 Respect buffer-local value of `org-edit-src-content-indentation'
* lisp/org-src.el (org-src--content-indentation): Introduce
permanently buffer-local variable for storing away the potentially
buffer-local value of `org-edit-src-content-indentation' in the source
buffer.

(org-src--contents-for-write-back): Use `org-src--content-indentation'
instead of `org-edit-src-content-indentation' in the edit buffer.

(org-src--edit-element): Set `org-src--content-indentation' in editing
buffer.  For greater clarity and consistency, rename already existing
let-bound variable `ind' to `block-ind'.
2019-11-20 22:29:30 +01:00
Marco Wahl b16c33409f Merge branch 'master' into next 2019-11-18 22:50:03 +01:00
Jack Kamm e69a85f4e1 org: Fix images failing to display with imagemagick
See also: https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00111.html
Despite the subject of that message thread, the issue also affects
some Linux users.

TINYCHANGE
2019-11-18 22:46:57 +01:00
Kyle Meyer 02551b8d4f Merge branch 'master' into next 2019-11-17 18:08:44 -05:00
ian 044e9718c1 org-timer.el: Allow org-timer-set-timer from non-Org buffers
* lisp/org-timer.el (org-timer--get-timer-title): If the current
buffer is not an Org buffer, use the buffer name as the timer title.

Currently all of the `org-timer-' operations work from any buffer
except `org-timer-set-timer' which must be run from an Org buffer.
This is because `org-timer-set-timer' sets a timer name based on an
Org heading or filename.  By setting the timer title to the current
buffer name we can use `org-timer-set-timer' from any buffer and
preserve the timer naming convention of using the buffer name if there
isn't an Org header.

TINYCHANGE
2019-11-17 18:06:00 -05:00
Kyle Meyer a4fa04bbd4 Merge branch 'master' into next 2019-11-16 17:19:11 -05:00
Kyle Meyer 6912382400 Merge branch 'maint' 2019-11-16 17:18:49 -05:00
Jonas Bernoulli 5117d8a159 Fix typos 2019-11-16 17:17:36 -05:00
Paul Eggert bc15277156 Backport commit 6b4a97c1c from Emacs
Fix some quoting glitches in doc strings
6b4a97c1c78f39ce890d100acceceb652d14e20d
Paul Eggert
Mon Nov 11 10:32:53 2019 -0800
2019-11-16 17:17:16 -05:00
Gustav Wikström 03c60c78b5 Docstring update
* lisp/org.el (org-archive-location): Update docstring due to the
addition of document property drawers.
2019-11-01 00:32:02 +01:00
Gustav Wikström 00646ad817 Fix newline-issue with document property drawer
A bug was squashed where newlines after insertion of document property
drawers wasn't handled correctly.

* testing/lisp/test-org.el (test-org/insert-property-drawer):
Add test to verify that the document property drawer is
inserted above keyword lines.  Also fix the specification for
document property drawer so it doesn't remove existing blank
rows if inserted at the top of a buffer.

* lisp/org.el (org-insert-property-drawer): Make sure to add
newline after document property drawers.
2019-10-31 23:56:03 +01:00
Kyle Meyer 64ab701078 Merge branch 'master' into next 2019-10-27 15:59:40 -04:00
Kyle Meyer a01a8f55d8 Merge branch 'maint' 2019-10-27 15:55:30 -04:00
Juanma Barranquero 9c611fd8ac Backport commit 41ba8231e from Emacs
* lisp/ob-scheme.el (org-babel-scheme-get-buffer-impl):
* lisp/ob-shell.el (org-babel--variable-assignments:sh-generic)
(org-babel--variable-assignments:bash_array)
(org-babel--variable-assignments:bash_assoc)
(org-babel--variable-assignments:bash):
* lisp/org-clock.el (org-day-of-week):
(table--put-cell-valign-property): Fix typos.
* lisp/ob-core.el (org-babel-named-src-block-regexp-for-name)
(org-babel-named-data-regexp-for-name): Doc fix.
(org-babel-src-block-names, org-babel-result-names): Fix typos.

lisp/*.el: Fix typos and improve some docstrings
41ba8231ef072571e1a6feabc15d113e5cf57556
Juanma Barranquero
Sun Oct 20 12:12:27 2019 +0200
2019-10-27 15:54:59 -04:00
Gustav Wikström 58ceff522b Handle attachment links more gracefully when expanding inline images
* lisp/org.el (org-display-inline-images): Introduce error-handling to
  ignore image display if the attachment link cannot be expanded for
  whatever reason.  For example if attachments are relative to the
  buffer, but the buffer is temporary and lacks filesystem location.
2019-10-26 02:38:53 +02:00
Marco Wahl 4667f04b2d Merge branch 'master' into next 2019-10-23 12:17:46 +02:00
Marco Wahl 28bb1c81fa agenda: Clarification of error message
* lisp/org-agenda.el (org-agenda-check-type): Mention also 'component'
  in the error message since it could be just the unallowed component
  in a composed agenda buffer from which some action has been
  triggered.
2019-10-23 12:13:54 +02:00
Marco Wahl b158aa452a Merge branch 'master' into next 2019-10-23 01:03:17 +02:00
Marco Wahl 80b29acba3 agenda: Enable navigation for the agenda dispatch buffer
* lisp/org-agenda.el (org-agenda-get-restriction-and-command): Use
  keys C-n, C-p, SPC, DEL analogue to export dispatcher.  See function
  org-export--dispatch-action.

Reported by Nathan Neff https://lists.gnu.org/archive/html/emacs-orgmode/2019-10/msg00179.html.
2019-10-23 00:54:53 +02:00
Gustav Wikström cffe44ba94 Merge branch 'master' into next 2019-10-21 14:58:39 +02:00
Gustav Wikström 42b8db0d34 Improve handling of org attach id to path functions
* doc/org-manual.org (Attachment options)
* etc/ORG-NEWS (Org-Attach has been refactored and extended)
(New ID method based on timestamp)
* lisp/org-attach.el (org-attach-id-uuid-folder-format)
(org-attach-id-ts-folder-format)
(org-attach-id-to-path-function-list, org-attach-dir)
(org-attach-dir-from-id): Better handling of id to path
functionality. At the same time adding an id-to-path function
for timestamp-based ID that easily can be promoted to the
primary function by customization of the user.
2019-10-20 02:49:48 +02:00
Gustav Wikström 1bdff9f73d Org document property-drawers
Add functionality to define property-blocks on document level, in
addition to at headline level.

* doc/org-manual.org:
* etc/ORG-NEWS: Document new functionality.

* lisp/org.el (org-keyword-regexp): Define constant instead of
  hardcoding.
(org-file-properties): Renamed, see next line.
(org-keyword-properties): Renamed from above.  Due to the fact that
  properties can be defined for the whole document using property
  drawers this local variable needs a rename to make its name less
  ambigous.
(org-refresh-properties, org-refresh-property, org-entry-properties)
(org-refresh-category-properties, org-get-property-block)
(org-entry-get-with-inheritance, org-entry-put)
(org-insert-property-drawer, org-end-of-subtree): Made to work before
  first headline.
(org-at-property-block-p): New function to validate if point is at the
start of a property block.
(org-property-global-value): Renamed, see next line.
(org-property-global-or-keyword-value): Renamed from above to match
  its functionality better.
(org-back-to-heading-or-point-min): New function to make a document
  work as a level 0 node in the outline.
(org-at-keyword-p): Predicate function to answer to if we're currently
at a keyword line or not.
(org-up-heading-or-point-min): New function to make a document work as
a level 0 node in the outline.

* lisp/org-element.el (org-element--current-element): Can now detect
  property-blocks before first headline according to it's positional
  rules.

* lisp/org-attach.el (org-attach): Make it possible to call the
  attachment dispatcher also before the first headline, since document
  property drawers make attachments possible for the whole document
  now.

* lisp/org-capture.el: Modified only due to rename of function in
  org.el.

* lisp/org-compat.el (org-file-properties)
(org-property-global-value): Renamed functions declared obsolete.

* testing/lisp/test-org.el (org/insert-property-drawer)
(org/set-property, org/delete-property, org/delete-property-globally):
  Additions of tests to check if they work before first headline.
(org/at-property-p, org/at-property-block-p, org/get-property-block)
(org/entry-get, org/refresh-properties): New tests

* testing/examples/property-inheritance.org: Switch from
  property-keywords to a property-drawer in the testfile.
  Functionality should be the same, but now using a document drawer
  instead of property-keywords.

  Reason for switching is that I'd like us to slowly depricate
  property-keywords.

* testing/lisp/test-org-element.el:

* contrib/lisp/ox-taskjuggler.el: A comment is modified only due to
  rename of function in org.el.
2019-10-19 14:07:58 +02:00
Nicolas Goaziou 8c5a788581 Remove duplicates in declare-function lines 2019-10-14 17:40:22 +02:00
Kovacsics Robert be8e68be0b ob-ocaml: Support for pretty-printed outputs
* lisp/ob-ocaml.el (org-babel-execute:ocaml): Support for
pretty-printed outputs.

E.g. the following snippet produces multiple lines of output, due to
pretty-printing

 #+BEGIN_SRC ocaml :exports code :eval no-export :results verbatim
(* Note, no need to have parentheses around sqrt, as
application binds the tightest *)
let rec gamma n = if n = 0
                  then (1.0 +. sqrt 5.0) /. 2.0
                  else 1.0 /. (gamma (n-1) -. 1.0)

let nums = List.map gamma (List.init 5 (fun x -> x))
 #+END_SRC

 #+NAME: gamma-tbl
 #+RESULTS[1fd6a3e846afdef51350eb6d7ba15c6844ccc14e]:
: val gamma : int -> float = <fun>
: val nums : float list =
:   [1.6180339887498949; 1.61803398874989468; 1.61803398874989535;
:    1.61803398874989357; 1.61803398874989823]

(In reality this would have 50 or so outputs, point being mathematically
it shouldn't change, but due to floating point errors it does.)

The regexp has the following problems:

- The "." in group 5 (as-was) doesn't match new-lines, so it only
  matches the first line, e.g. as a list
  : - [1.6180339887498949, 1.61803398874989468, 1.61803398874989535,

- When using "\\(.\\|\n\\)", it includes the starting indentation of the
  list, which makes org-babel-script-escape choke (called from
  org-babel-ocaml-read-list, from org-babel-ocaml-parse-output, from
  org-babel-execute:ocaml, the code being modified.

TINYCHANGE
2019-10-13 09:44:54 +02:00
Nicolas Goaziou 049f9f89d0 ol: Fix opening help links
* lisp/ol.el ("help"): Fix typo in function opening help links.
2019-10-13 09:33:44 +02:00
Jens Lechtenboerger 7735362101 ox-html: Control wrapping of source lines
* lisp/ox-html.el (org-html-format-code, org-html-do-format-code):
  Use new export option :html-wrap-src-lines with variable
  org-html-wrap-src-lines to control whether source code lines should
  be wrapped in code elements or not.
* doc/org-manual.org: Document the new option
2019-10-13 09:27:34 +02:00
Nicolas Goaziou 1ec975f925 ox-latex: Exclude newline from labels within captions
* lisp/ox-latex.el (org-latex--caption/label-string): Exclude newline
character from labels within captions.

Reported-by: Godefroy <godefroy.vannoye@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-10/msg00088.html>
2019-10-13 09:23:50 +02:00
Anton-Latukha 1f8b454825 org.el: fx org-get-priority-function funcall (give arg - headline)
* org.el (org-get-priority): Fix to allow the use of custom priority
getters.
Provide the headline as argument to the custom priority getter
function.
2019-10-08 11:23:20 +02:00
Robert Irelan d1c9e1de68 ox-publish: signal org-link-broken for broken fuzzy links
* lisp/ox-publish.el (org-publish-resolve-external-link): Signal
`org-link-broken' when `org-link-search' fails to resolve a link.
Without this change, a broken fuzzy link will always abort the export
even when `org-export-with-broken-links' is non-nil.
2019-10-08 11:18:13 +02:00
Kyle Meyer d215c3a8c0 Merge branch 'maint' 2019-09-29 15:49:08 -04:00
Paul Eggert e3090573be Backport commit 946a56a10 from Emacs
* lisp/org.el (org-doi-server-url): Prefer https: to http: un URLs.

Update some URLs
946a56a10fed769646a8b7c4ebc53f53c84be896
Paul Eggert
Mon Sep 23 00:12:52 2019 -0700

Notes(km):

  - It's not mentioned in 946a56a10's message, but that commit also
    drops the dx subdomain, an "earlier syntax which continues to be
    supported" according to https://www.doi.org/factsheets/DOI_PURL.html.

  - 946a56a10 replaced a link in the manual with https://api.uva.nl/
    (which the previous link redirects to).  Here we instead use the
    replacement link from master's f4083eefd (manual: Fix URL,
    2019-06-01).
2019-09-29 15:47:58 -04:00
Juanma Barranquero 97feee0469 Backport commit 114323226 from Emacs
* lisp/ob-C.el (org-babel-prep-session:C)
(org-babel-load-session:C):
* lisp/ob-J.el (org-babel-execute:J):
* lisp/ob-asymptote.el (org-babel-prep-session:asymptote):
* lisp/ob-awk.el (org-babel-execute:awk):
* lisp/ob-core.el (org-babel-process-file-name):
* lisp/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/ob-forth.el (org-babel-execute:forth):
* lisp/ob-fortran.el (org-babel-execute:fortran)
(org-babel-prep-session:fortran, org-babel-load-session:fortran):
* lisp/ob-groovy.el (org-babel-execute:groovy):
* lisp/ob-io.el (org-babel-execute:io):
* lisp/ob-js.el (org-babel-execute:js):
* lisp/ob-lilypond.el (org-babel-default-header-args:lilypond)
(org-babel-lilypond-compile-post-tangle)
(org-babel-lilypond-display-pdf-post-tangle)
(org-babel-lilypond-tangle)
(org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-compile-lilyfile)
(org-babel-lilypond-check-for-compile-error)
(org-babel-lilypond-process-compile-error)
(org-babel-lilypond-mark-error-line)
(org-babel-lilypond-parse-error-line)
(org-babel-lilypond-attempt-to-open-pdf)
(org-babel-lilypond-attempt-to-play-midi)
(org-babel-lilypond-switch-extension)
(org-babel-lilypond-set-header-args):
* lisp/ob-lua.el (org-babel-prep-session:lua):
* lisp/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/ob-processing.el (org-babel-prep-session:processing):
* lisp/ob-python.el (org-babel-prep-session:python):
* lisp/ob-scheme.el (org-babel-scheme-capture-current-message)
(org-babel-scheme-execute-with-geiser, org-babel-execute:scheme):
* lisp/ob-shen.el (org-babel-execute:shen):
* lisp/org-agenda.el (org-agenda-entry-types)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-time-grid, org-agenda-sorting-strategy)
(org-agenda-filter-by-category, org-agenda-forward-block):
* lisp/org-faces.el (org-verbatim, org-cycle-level-faces):
* lisp/org-indent.el (org-indent-set-line-properties):
* lisp/org-macs.el (org-get-limited-outline-regexp):
* lisp/org-mobile.el (org-mobile-files):
* lisp/org.el (org-use-fast-todo-selection)
(org-extend-today-until, org-use-property-inheritance)
(org-refresh-effort-properties)
(org-track-ordered-property-with-tag, org-shiftright):
* lisp/ox-html.el (org-html-checkbox-type):
* lisp/ox-man.el (org-man-source-highlight)
(org-man-verse-block):
* lisp/ox-publish.el (org-publish-sitemap-default): Assorted
docfixes.

lisp/*.el: Fix typos and other trivial doc fixes
11432322650830fe9ae365f4113733a79226056d
Juanma Barranquero
Sat Sep 21 00:27:53 2019 +0200
2019-09-29 15:47:58 -04:00
Juanma Barranquero 001306c1c0 Backport commit 79a01866a from Emacs
* lisp/org-agenda.el (org-agenda-change-all-lines)
(org-agenda-today-p):
* lisp/org-id.el (org-id-get):
* lisp/org.el (org-highlight-latex-and-related)
(org--valid-property-p):
* lisp/ox-beamer.el (org-beamer--get-label):
* lisp/ox-latex.el (org-latex--caption-above-p):
* lisp/ox-odt.el (org-odt--copy-image-file)
(org-odt--copy-formula-file):
* lisp/ox.el (org-export-with-timestamps): Fix typos in docstrings.

lisp/*.el, src/*.c: Fix typos in docstrings
79a01866a01754b9f566af76ef96e80cd90d094b
Juanma Barranquero
Thu Sep 19 04:32:25 2019 +0200
2019-09-29 15:47:57 -04:00
Gustav Wikström 6175593530 Fix predicate comment string
Ref. (info "(elisp) Documentation Tips")

* lisp/org.el (org-at-comment-p, org-at-drawer-p)
(org-at-block-p): Fix documentation.
2019-09-29 09:02:17 +02:00
Marco Wahl 1fd07c1eeb Fix org-activate-links
* lisp/org.el (org-activate-links): Set the match group number
  back.  See commit d07d8ff4 for the number switch.
2019-09-18 10:45:21 +02:00
Mario Schlegel 23113feb9a ox-latex: Extend :placement attribute to source blocks
* lisp/ox-latex.el (org-latex-src-block): Extend :placement attribute
to source blocks when the minted package is used.

TINYCHANGE
2019-09-16 18:59:43 +02:00
Max Mouratov d07d8ff416 Prevent loss of `re-search-forward' results
* org.el (org-activate-links): `match-beginning' and `match-end` should
be called shortly after `re-search-forward'. Otherwise, they may return
values corresponding to a different invocation of `re-search-forward'.

TINYCHANGE
2019-09-16 18:55:04 +02:00
Nicolas Goaziou 55d3dfaaf8 org-macs: Fix indentation for full-width characters
* lisp/org-macs.el (org-do-remove-indentation): Handle full-width characters.

When the least indented line in buffer begins from fullwidth character
like 'あ', a Japanese character, `org-do-remove-indentation' doesn't
remove indentation at all or removes improperly.

e.g. 'あ' with 2 spaces indent

-----[buffer begin]-----
  あ
-----[buffer   end]-----
`org-do-remove-indentation' does nothing in this buffer.

Expected result is:
-----[buffer begin]-----
あ
-----[buffer   end]-----

Reported-by: Yuichiro Hakozaki <sankaku.git@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-09/msg00075.html>
2019-09-16 18:42:59 +02:00
Mike Ivanov 02f506baf8 ob-lisp: Strip quotes from result value
* lisp/ob-lisp.el (org-babel-execute:lisp): Make sure that when
a singular string value is returned, it has no quotation marks around
it.

Before this change, the code below would produce an incorrect result:

  #+BEGIN_SRC lisp :results file
  "plot.png"
  #+END_SRC

  #+RESULTS:
  [[file:"plot.png"]]

After the change:

  #+BEGIN_SRC lisp :results file
  "plot.png"
  #+END_SRC

  #+RESULTS:
  [[file:plot.png]]

TINYCHANGE
2019-09-16 18:38:16 +02:00
Carsten Dominik 6f32e7af88 Merge branch 'improve-consistency-in-filter-commands' 2019-09-09 07:36:06 +02:00
Kyle Meyer 8919181c12 org-attach-git: Silence byte-compiler
* lisp/org-attach-git.el (org-attach-git-commit): Rename argument to
silence byte-compiler.
2019-09-08 11:41:53 -04:00
Gustav Wikström 930a1bcfc5 Fix problems with org-attach-git, failed tests
Ref. mail "[O] git-annex-related org-attach tests failing on
master"
https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00030.html
* lisp/org-attach-git.el (org-attach-git-commit): Add optional
argument to function contract to make it work with
`org-attach-after-change-hook'.  Even though that argument is
not used in the actual code (due to legacy functionality).

* testing/lisp/test-org-attach.el
(test-org-attach/dired-attach-to-next-best-subtree/1)
(test-org-attach/dired-attach-to-next-best-subtree/2):
Modify tests to also work if user has git-annex installed

* testing/lisp/test-org-attach-git.el
(test-org-attach-git/use-annex): Correct errors from previous
commit, where git-annex was refactored out from org-attach
into it's separate module.
2019-09-08 14:43:46 +02:00
Carsten Dominik 711852ec67 Bug fix in tags filter: Treat SPC selection correctly.
* lisp/org-agenda.el (org-agenda-filter-make-matcher-tag-exp): Fix
filtering for any tag at all.
2019-09-07 15:04:03 +02:00
Carsten Dominik c79f5398cc Rename filter prefix argument to STRIP-OR-ACCUMULATE for clarity
* lisp/org-agenda.el (org-agenda-filter-by-regexp)
(org-agenda-filter-by-effort, org-agenda-filter)
(org-agenda-filter-by-tag): Rename prefix argument for code readability.
2019-09-07 13:15:55 +02:00
Carsten Dominik 9e09c8d267 Improve docstring of `org-agenda-filter-by-category' 2019-09-06 15:58:17 +02:00
Carsten Dominik c47a7394a0 Improve documentation string of `org-agenda-filter-by-regexp'
* lisp/org-agenda.el (org-agenda-filter-by-regexp): Improve docstring.
2019-09-06 15:49:04 +02:00
Carsten Dominik c580a290ac Normalize the use of `C-u' for `org-agenda-filter-by-effort' 2019-09-06 15:48:44 +02:00