Commit Graph

15693 Commits

Author SHA1 Message Date
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
Carsten Dominik 124017b6d3 Normalize the use of `C-u' in `org-agenda-filter-by-tag' 2019-09-06 10:47:21 +02:00
Carsten Dominik 697358605a Normalize the use of `C-u' in `org-agenda-filter'
* lisp/org-agenda.el (org-agenda-filter): Make the applications of
single and double prefix arguments consistent with other filtering commands.
2019-09-06 10:17:35 +02:00
Nicolas Goaziou f2f646b6c9 ox-icalendar: Allow ignoring done scheduled or deadlines tasks
* lisp/ox-icalendar.el (org-icalendar-use-deadline):
(org-icalendar-use-scheduled): Add a value to ignore done tasks.
2019-09-05 21:54:50 +02:00
Michaël Cadilhac 9586db1248 org-clock: Add an option to not show the file column in clock report
* lisp/org-clock.el (org-clocktable-defaults): Add `hidefiles'.
(org-dblock-write:clocktable): Implement not showing files when
`hidefiles' is true.
* lisp/org-pcomplete.el: Add `hidefiles'.
2019-09-05 18:56:28 +02:00
Michaël Cadilhac 876a4419dd Fontify drawers correctly.
* lisp/org.el (org-fontify-drawers): Fix face used, fix range of text
properties.
(org-set-font-lock-defaults): Fontify drawers after keywords.
2019-09-05 18:53:26 +02:00
Nicolas Goaziou 893866f86b Merge branch 'maint' 2019-09-05 15:06:08 +02:00
Nicolas Goaziou 97c14ca8cd ox-latex: Fix Brazilian entry in Polyglossia languages
* lisp/ox-latex.el (org-latex-polyglossia-language-alist): Fix
Brazilian entry.  Sort lines.
2019-09-05 15:05:06 +02:00
Carsten Dominik 18c69675ae Document `org-agenda-auto-exclude-function' can select positively
* lisp/org-agneda.el: (org-agenda-auto-exclude-function):  Update
documentation.
2019-09-04 09:50:56 +02:00
Carsten Dominik 05cb7cb4ad Fix bugs in filtering 2019-09-04 09:41:29 +02:00
Carsten Dominik 6413bc75a0 Fix bug in tag filter
* lisp/org-agenda.el (org-agenda-filter-by-tag): Use the correct
character to clearing the filter.
2019-09-04 08:20:29 +02:00
Bastien cff97c361a Bump Version keyword 2019-09-04 06:53:49 +02:00
Carsten Dominik 0dd77866cc Remove double function definition introduced by accident in 7ee4cb0245 2019-09-03 16:05:40 +02:00
Carsten Dominik 9962df2b48 Merge branch 'make-new-filter-interface-the-default' 2019-09-03 15:50:34 +02:00
Carsten Dominik 7ee4cb0245 Revert `org-agenda-filter-by-category' to non-prompting state 2019-09-03 15:47:39 +02:00
Gustav Wikström 4b7eda1a2f org-attach, test-org-attach: Restore fs check in org-attach-dir
In commit ae9cd4370 the filsystem check for org-attach-dir was
removed.  Adding it back here, together with an optional flag to
override the check.

To satisfy compatabilty issues with org-brain. Ref. thread here:
- https://github.com/Kungsgeten/org-brain/pull/203
2019-09-02 23:15:13 +02:00
Gustav Wikström dea0c70c7b org-id: Add decimals to ISO 8601 timestamp when used as ID
With nanoseconds precision in the timestamp risk for duplicates shall
be ... near 0 ... even in heavy teamwork-environments or heavily
scripted setups.
2019-09-01 14:48:16 +02:00
Gustav Wikström 032148b8d3 org-attach: Reword dispatcher and make f/F create if not exist
Change from "task" to "node" in `org-attach-commands'.  More general
that way.

Also change default behaviour for f and F commands when an attachment
is declared by ID or DIR property but not yet created in the
filesystem.
2019-09-01 14:43:54 +02:00
Carsten Dominik f230b730c5 Make the new filter interface the default, and improve the manual
* lisp/org-agenda.el: Bind `org-agenda-filter' to `/` and move
`org-agenda-filter-by-tag' to `\`.
* doc/org-manual (Filtering/limiting agenda items): Improve the entire
section.
2019-09-01 09:12:47 +02:00
Carsten Dominik ef5863b311 Improve the text describing the tags/property matche
* lisp/org-agenda.el (org-agenda-custom-commands): Improve the text
describing the tags/property matches
2019-08-31 13:47:25 +02:00
Nicolas Goaziou df30a056b2 Fix tangling bug when major mode for LANGUAGE is not `LANGUAGE-mode'
* lisp/ob-core.el (org-babel-expand-noweb-references):
* lisp/ob-tangle.el (org-babel-tangle): Use `org-src-get-lang-mode' so
as to use proper major mode.

Reported-by: immanuel <immanuel.litzroth@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00272.html>
2019-08-30 23:36:00 +02:00
Carsten Dominik 713a414713 Small improvements to filtering
* lisp/org-agenda.el (org-agenda-filter): Append new filter elements
instead of prepending them.  And allow an additional leading `+' to
signal that the new elements should be added to the current filter
instad of replacing them.
2019-08-30 08:35:27 +02:00
Carsten Dominik 3ac2fb6c5f Merge branch 'improvements-to-agenda-filters' 2019-08-29 22:04:15 +02:00
Carsten Dominik 4edf93a6de Fix compiler warnings in the new filter code 2019-08-29 22:02:31 +02:00
Carsten Dominik 69bf64419b Add new generic filter interface
* lisp/org-agenda.el (org-agenda-filter): New function.
(org-agenda-filter-completion-function): New function.
2019-08-29 18:06:10 +02:00
Marco Wahl 48da60f47a org: Relax dependance on imagemagick for image width setting
* lisp/org.el (org-display-inline-images): Don't depend on image type
  imagemagick for rescaling.  When imagemagick is available use that
  type at image creation.

Reported by Terje Larsen.

https://lists.gnu.org/archive/html/emacs-orgmode/2019-08/msg00303.html
2019-08-29 17:28:58 +02:00
Carsten Dominik 6543716d67 Compactify the modeline display of filters
* lisp/org-agenda.el (org-agenda-filter-variables): New constant.
(org-agenda-filter-any): New function.
2019-08-29 11:38:14 +02:00
Carsten Dominik 36dc6ae644 Lay the groundwork for new filter interface
* lisp/org-agenda.el (org-agenda-get-represented-categories):
New function.
(org-agenda-get-represented-tags): Added a caching mechanism.

* (org-agenda-all-categories): Removed again, deferring to
`org-agenda-get-represented-categories'.

* lisp/org-agenda.el (org-agenda-represented-categories)
(org-agenda-represented-tags): New variables.
(org-agenda-finalize): Remove the caches for represented tags
and categories.
2019-08-29 11:38:14 +02:00
Carsten Dominik fa792e9231 Show a message when category filter has been removed
* lisp/org-agenda.el (org-agenda-filter-by-category): Show a
message when filter has been removed.
2019-08-29 11:38:14 +02:00
Carsten Dominik 8c011126b5 Make pressing `_' twice in agenda remove the effort filter
* lisp/org-agenda.el (org-agenda-filter-by-effort): Pressing `_' again
will remove the effort filter.  This aligns the command with the tags
filter.
2019-08-29 11:38:14 +02:00
Carsten Dominik 8dfe826a0b Agenda category filter now offers completion for categories
* lisp/org-agenda.el (org-agenda-all-categories): New function.
(org-agenda-filter-by-category): Implement completion on categories.
2019-08-29 11:38:14 +02:00
Carsten Dominik 7893737406 Add the filter commands to the agenda menu
* lisp/org-agenda.el (easy-menu-define): Add filter commands.
2019-08-29 11:38:14 +02:00
Marco Wahl 3c24be0945 org: Equip inline images with key-map `image-map' 2019-08-26 22:53:24 +02:00
Kyle Meyer 6f5516953f Merge branch 'maint' 2019-08-25 11:51:12 -04:00
Paul Eggert 190a3b6c4e Backport commit 221a3272a from Emacs
* lisp/org-table.el (org-table-message-once-per-second):
Fix bug when clock difference goes past a 65536-second boundary.
Don’t assume particular format for current-time result.

Fix org-table 65536-second bug
221a3272ad4a1befb41dda2990d672782bc0257f
Paul Eggert
Mon Aug 19 18:05:15 2019 -0700

Note(km): time-less-p and time-subtract have been replaced with the
corresponding Org compatibility functions.
2019-08-25 11:47:17 -04:00
Nicolas Goaziou 73c0989037 Fix last commit 2019-08-24 22:58:29 +02:00
Nicolas Goaziou ed048fa83d Fix %start-line in `org-babel-tangle-comment-links'
* lisp/ob-tangle.el (org-babel-tangle-comment-links): %start-line
reports the line number, not the buffer position at the beginning of
line.

Reported-by: immanuel <immanuel.litzroth@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00267.html>
2019-08-24 22:44:18 +02:00
Nicolas Goaziou d64f7a2c9b Silence byte-compiler 2019-08-24 00:11:07 +02:00
Marco Wahl d83149bad1 org-agenda: Display duration of clocking without end time 2019-08-23 10:45:37 +02:00
Nicolas Goaziou 784adcd844 Do not pollute `narrow-map' keymap
* lisp/org-keys.el (org-map-map): Use `org-mode-map' instead of
`narrow-map'.

Reported-by: Omar Antolín Camarena <omar@matem.unam.mx>
<http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00256.html>
2019-08-23 10:38:43 +02:00
Abhishek Chandratre c57f12b707 Fix org-store-link for eshell
lisp/ol-eshell.el (org-eshell-store-link): Replace `dired-directory'
variable with `eshell/pwd' function to find current directory.

During org-store-link `dired-directory' variable returns nil.
Thus replacing it with (eshell/pwd), which returns pwd.

TINYCHANGE
2019-08-22 19:11:04 +02:00
Nicolas Goaziou 4848b8b9aa ob: Preserve comma escaping when inserting results
* lisp/ob-core.el (org-babel-insert-result): Fix typo
* testing/lisp/test-ob.el (test-ob/preserve-comma-escape): New test.

Reported-by: "Berry, Charles" <ccberry@ucsd.edu>
<http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00250.html>
2019-08-22 10:03:56 +02:00
Christian Dietrich a72466ce8d Fix bug in org-babel-tangle-file with symlinked files
Assume that there is file A and symlink B that points to file A. If
there is an open buffer that points to A and we
call (org-babel-tangle-file "B"), then this function kills the buffer
since get-file-buffer does not follow symlinks.
2019-08-22 09:50:26 +02:00
Carsten Dominik 96cc762ff3 Remove duplicate selection letters from tag filter prompt.
* lisp/org-agenda.el (org-agenda-filter-by-tag): Remove duplicate
selection letters from tag filter prompt.  If tag groups were the same
in multiple agenda files, the selection characters would be repeated
in the prompt.
2019-08-20 17:58:31 +02:00
Nicolas Goaziou f3474724ad ol: Allow [[\\\\]] links
* lisp/ol.el (org-link-make-regexps): Allow [[\\\\]] links.
2019-08-20 14:24:38 +02:00
Nicolas Goaziou 4f3d1eefbd Remove `org-enable-fixed-width-editor'
* lisp/org.el (org-enable-fixed-width-editor): Remove variable.
2019-08-19 12:22:22 +02:00
Kyle Meyer c7c04b0447 Merge branch 'maint' 2019-08-18 17:44:08 -04:00
Kyle Meyer 9e1b9fe627 Port more time-related changes
* lisp/org-agenda.el (org-agenda-check-clock-gap):
* lisp/org-clock.el (org-clock-get-clocked-time)
(org-clock-resolve-clock, (org-clock-resolve)
(org-resolve-clocks, org-resolve-clocks-if-idle)
(org-clock-in, org-clock-out, org-clock-sum, org-clocktable-steps):
* lisp/org-element.el (org-element-cache-sync-duration)
(org-element--cache-set-timer, org-element--cache-interrupt-p):
(org-element--cache-sync):
* lisp/org-habit.el (org-habit-insert-consistency-graphs):
* lisp/org-indent.el (org-indent-add-properties):
* lisp/org-timer.el (org-timer-start):
(org-timer-pause-or-continue, org-timer-set-timer):
* lisp/org.el (org-today, org-auto-repeat-maybe): Port time-related
changes from the Emacs repo by using compatibility wrappers.

In the Emacs repo, there has been a lot of changes to Org files
involving time-related code.  I've ported some of those changes but
have largely ignored any changes that break compatibility with older
Emacsen that we support.  That, however, isn't a good approach because
it will be hard to do a systematic update once we bump our minimum
Emacs requirement.  Instead use the recently added compatibility
wrappers where needed, which is ugly but more maintainable.

The main time-related changes this leaves unported are changes that
replace (apply #'encode-time args) calls with (encode-time args).
Until the first form is unsupported, adding a compatibility function
doesn't seem worth the churn.

Relevant Emacs commits include
c75f505dea6a560b825384cf3d277690f86840bf,
57c74793c46c6533b63836f00aecaf3ac2accb6d,
988e37fa0f922b852715671d59a0e3f682373411,
476066e89d6f0bb87220da690b8a476bf9655b80,
89c63b3522b62c0fd725f0b348927a2069238452.
2019-08-18 17:37:51 -04:00
Kyle Meyer d72b4af96e org-clock: Adjust steps calculation for Emacs 24 compatibility
* lisp/org-clock.el (org-clocktable-increment-day): Use
org-decode-time so that integer can be given for time on Emacs 24.
(org-clocktable-steps): Work with a float rather than internal time to
avoid "Invalid time specification" error on Emacs 24.

This fixes the failure of test-org-clock/clocktable/step on Emacs 24.
Note that the version of org-clocktable-steps on master has been
reworked and does not share this issue.
2019-08-18 17:36:13 -04:00
Kyle Meyer a23d0225ab org-time-stamp: Simplify encode-time call
* lisp/org.el (org-time-stamp): Use org-time-string-to-time.

This should have been applied with a6cead0d2 (Backport commit
476066e89 from Emacs, 2019-02-22).
2019-08-18 17:36:13 -04:00
Paul Eggert 74bf99502d Backport commit 988e37fa0 from Emacs
* lisp/org-agenda.el (org-agenda-get-timestamps, org-agenda-get-progress)
(org-agenda-show-clocking-issues):
* lisp/org-capture.el (org-capture-set-target-location):
* lisp/org-clock.el (org-clock-get-sum-start):
* lisp/org.el (org-current-time, org-store-link)
(org-read-date, org-read-date-display)
(org-display-custom-time, org-timestamp-to-time)
Simplify use of encode-time.
* lisp/org-clock.el (org-clock-in, org-clock-update-time-maybe):
* lisp/org-colview.el (org-columns--age-to-minutes):
* lisp/org-macs.el (org-2ft):
* lisp/org.el (org-get-scheduled-time, org-get-deadline-time)
(org-add-planning-info, org-time-string-to-absolute)
(org-closest-date):
Use org-time-string-to-time instead of doing it by hand with
encode-time.
* lisp/org.el (org-read-date): Avoid extra trip through encode-time.

Simplify use of encode-time
988e37fa0f922b852715671d59a0e3f682373411
Paul Eggert
Sun Feb 10 23:54:35 2019 -0800

Note(km): org-current-time has been modified to use org-time-subtract
and org-time-less-p for backward compatibility.  Some changes from
988e37fa0 have been dropped to keep encode-time's call compatible with
older Emacsen.
2019-08-18 17:36:13 -04:00
Paul Eggert a3fcf6dff4 Backport commit 3d1c9a77c from Emacs
* lisp/org-timer.el (org-timer-show-remaining-time):
Don’t assume the remaining time is less than one hour.
Simplify.  The simplification removes the need for a
decode-time, and fixes a typo I introduced recently.

Fix org-timer-show-remaining-time > 1 hour
3d1c9a77c52664c8c3e4fa1ae25e1d13aab9b2f9
Paul Eggert
Sat Aug 17 17:22:25 2019 -0700

Note(km): This replaces porting of Emacs's c90a420779 (Add FIXMEs for
subsecond support, 2019-08-17).  It's modified to use
org-time-subtract and org-time-convert-to-integer for backward
compatibility.
2019-08-18 17:36:13 -04:00
Kyle Meyer bdc5861cf7 org-compat: Add kludges for time-related functions
* lisp/org-compat.el (org-decode-time, org-format-time-string)
(org-time-add, org-time-less-p, org-time-since, org-time-subtract):
New compatibility functions.

On Emacs 24, these functions are stricter about what they accept for
time.  These new function will be used to port over changes in the
Emacs repo.  Don't bother doing a bulk substitution in existing Org
code because that would produce a lot of churn and these calls should
already be compatible with Emacs 24.
2019-08-18 17:36:12 -04:00
Kyle Meyer 24ba689506 org-compat: Add time-convert compatibility wrappers
* lisp/org-compat.el (org-time-convert-to-integer)
(org-time-convert-to-list): New defsubt's to replace common
invocations of time-convert (new in Emacs 27).
* lisp/org-compat.el (org-current-time-as-list): Drop in favor of
org-time-convert-to-list.

These will be used to port changes from the Emacs repo.
2019-08-18 17:31:05 -04:00
Nicolas Goaziou 3405b9afac Hide newly created properties drawers
* lisp/org.el (org-flag-drawer): Change signature.
(org-insert-property-drawer): Hide newly created properties drawers.
2019-08-17 17:47:01 +02:00
Kyle Meyer 4e3a1b3f5a org-compat: Move proper-list-p kludge to proper section 2019-08-17 09:54:35 -04:00
Kyle Meyer 531f4be256 org-compat: Define org-xor as alias for xor if available
* lisp/org-macs.el (org-xor): Move to ...
* lisp/org-compat.el (org-xor): ... here, making it an alias for xor
on Emacs 27.

This is an alternative to porting Emacs's
c676444a43e4634c1f98ec286b5bd9e46b23216b, which targets the code prior
to 45a1918ef (Move `org-xor' into "org-macs.el", 2017-10-17).
2019-08-17 09:54:32 -04:00
Paul Eggert 218e694964 Backport commit c6ba8100e from Emacs
* lisp/org-id.el (org-id-time-to-b36):
Remove unnecessary ‘or’.

Fix minor Org timestamp inefficiencies
c6ba8100ea1db4616d3fe8485430b29143bc3d2e
Paul Eggert
Mon Aug 5 17:38:15 2019 -0700
2019-08-17 09:45:22 -04:00
Paul Eggert 08c7bbbf71 Backport commit a5b796a87 from Emacs
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs):
Omit unnecessary ‘?’ after nullable pattern.
* lisp/org-capture.el (org-capture-fill-template):
Match upper-case as well as lower-case letters.

Fix 2019-08-04 regex lint
a5b796a8798a809044d847568e6472cc5eca077e
Paul Eggert
Sun Aug 4 11:39:54 2019 -0700
2019-08-17 09:45:22 -04:00
Paul Eggert 71ce18920a Backport commit 5f3f3884a from Emacs
Improve time function doc
5f3f3884a0d2a88101d330b82ef5b584cfc02aa6
Paul Eggert
Sun Aug 4 10:09:25 2019 -0700
2019-08-17 09:45:22 -04:00
Basil L. Contovounesios 765577d9b3 Backport commit 2267110b6 from Emacs
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org-agenda.el (org-agenda-show-new-time):
Always pass an explicit plist to remove-text-properties.

Fix usage of remove-text-properties
2267110b6f00bbb0ad87f4621e6ecd9dc1bd8581
Basil L. Contovounesios
Thu Aug 1 17:04:53 2019 +0300
2019-08-17 09:45:22 -04:00
Eric S Fraga cfe4598aa1 Add split-window-right option for editing source blocks
* org-src.el (org-src-window-setup, org-src-switch-to-buffer): Added
  new split-window-right option which splits horizontally.

This has been motivated by the increasing use of wide monitors.
2019-08-17 15:26:32 +02:00
Henrik Koschitzki 4e854974be ob-plantuml: Allow different @start-/@end clauses
* lisp/ob-plantuml (org-babel-plantuml-make-body) Do not insert
@startuml and @enduml if body already starts with "@start".

PlantUML supports non-UML diagrams that have to be enclosed with
@startgantt/@endgantt for example.  The code for these diagrams can
contain the proper clauses without being enclosed additionally with
@startuml/@enduml.
2019-08-17 14:26:26 +02:00
Renato Ferreira 413736f315 org-todo: Respect state argument when called from elisp
* lisp/org.el (org-todo): Respect argument when called from elisp when
calling from elisp (such as in `org-clock-in').

Fast selection should only be shown if a state argument was not used.
This fixes a regression introduced by f1c030bed (Prefix argument to
`org-todo' forces stage change logging, 2019-08-14).

TINYCHANGE
2019-08-16 18:30:09 -04:00
Marco Wahl f51e88bed8 Fix descriptive text in the menu of org-search-view 2019-08-16 13:17:28 +02:00
Carsten Dominik 59ae60c26a Add `org-overriding-columns-format' as an option in custom views
* lisp/org-agenda.el (org-agenda-custom-commands-local-options): Add
`org-overriding-columns-format'.
2019-08-16 09:49:29 +02:00
Carsten Dominik 07e48a7af6 Merge branch 'fix-org-columns-formatdocumentation' 2019-08-16 09:37:54 +02:00
Carsten Dominik 6dda536f9f Clear up unclear setting of columns format for the agenda
* lisp/org.el (org-columns-default-format-for-agenda): New option.

* lisp/org-colview.el (org-overriding-columns-format): Updated documentation.
(org-agenda-columns): `Use org-columns-default-format-for-agenda'

* doc/org-manual.org (Using Column View in the Agenda): Fix the
description how to set the columns format for agenda views.
2019-08-16 09:34:55 +02:00
Carsten Dominik 92c2265794 Merge branch 'improve-fast-todo-selection' 2019-08-16 08:49:43 +02:00
Nicolas Goaziou 299ec9e721 Merge branch 'maint' 2019-08-15 10:06:21 +02:00
Nicolas Goaziou bf8ae63588 ox-latex: Fix typo in Brazilian language code
* lisp/ox-latex.el (org-latex-babel-language-alist): Fix typo.
2019-08-15 10:05:42 +02:00
Carsten Dominik 4d88d41430 Cleanup code 2019-08-14 10:32:03 +02:00
Carsten Dominik f1c030bed5 Prefix argument to `org-todo' forces stage change logging
* lisp/org.el (org-use-fast-todo-selection): Allow values
`auto' and `expert'.
(org-todo): Change the interpretation of the prefix argument.
A single `C-u' now forces taking a logging time stamp and note.
(org-fast-todo-selection): Implement the `expert' option of
`org-use-fast-todo-selection' and avoid showing the selection
window.  Instead, show the options in the prompt.

* doc/org-manual.org: (Basic TODO Functionality): Document that `C-u
C-c C-t' is the simplest way to log a TODO state change.
(TODO keywords as workflow states): Slightly simplify text.
(TODO keywords as types): Document that tags should be used instead.
(Progress Logging, Closing items, Tracking TODO state changes):
Document that `C-u C-c C-t' is the simplest way to log a TODO
state change.
(Remote editing): Document using a prefix to the `org-agenda-todo'
command logs the state change.
(Using CDLaTeX to enter math): Document that CDLaTeX is	available on
MELPA.

* doc/org-guide.org (Progress Logging): Document the use of a
prefix to `org-todo' to force logging.
2019-08-14 09:58:38 +02:00
Carsten Dominik f5d27e046a Fix bug dealing with the width field of categories in agenda
lisp/org-agenda.el (org-compile-prefix-format): Fix bug dealing with
the width field of categories.  Fix by Héctor Enríquez Ramón.
2019-08-12 13:30:38 +02:00
Carsten Dominik e3856a0c8e Fix tag alignment after todo state change with empty headline
* lisp/org.el (org-todo): Fix tag alignment with empty headline.
2019-08-12 11:35:29 +02:00
Carsten Dominik 495826e897 Make it customizable if block lines should be fontified to end
* lisp/org.el (org-fontify-whole-block-delimiter-line): New option.

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Use
`org-fontify-whole-block-delimiter-line'. Also, clean-up the function.
2019-08-12 09:03:29 +02:00
Carsten Dominik 20d9fefe4e Hide drawer contenxt after sorting entries
2019-08-10  Carsten Dominik  <carsten.dominik@gmail.com>

* lisp/org.el (org-sort-entries): Hide drawers after sort.
2019-08-10 07:58:28 +02:00
Carsten Dominik de3faf0767 Improve TODO selection if some keys are present in several sequences
* lisp/org.el (org-todo): Give the current state as an
argument to `org-fast-todo-selection'.
(org-fast-todo-selection): Accept current state as an
argument.  Use that state to find out to which TODO sequence
the current state belongs and use that to make the right
choice if selection keys are not unique globally.  For
example, if you have a task sequence, and a project sequence,
you could use the "d" selection key in both sequences to
switch to the appropriate DONE (or e.g. PRDN) state.
2019-08-09 23:00:21 +02:00
Carsten Dominik db6952cfe4 Improve docstring of `org-todo' 2019-08-09 10:04:02 +02:00
Gustav Wikström 60e5faf676 org-element: Fixing typo's 2019-08-03 13:35:27 +02:00
Gustav Wikström b082de626d org-id: Additional id method; ISO8601 timestamp
* New choice in org-id-method

Timestamps can be chosen as org-id-method.  This id-method has the
benefit of being human-readable and has synergies with org-attach if
one likes to organize attachment directories by timestamp instead of
by random names.
2019-08-02 17:02:01 +02:00
Gustav Wikström 9104c0c52d org-id: New customization, org-id-locations-file-relative
* org-id-locations-file-relative

New customization that allows the user to specify that filenames
should be saved relative to the file specified in
org-id-locations-file, instead of being absolute paths.

* org-id-locations-save

Respects new custom variable, org-id-locations-file-relative, and
can save locations with relative filenames.

* org-id-locations-load

Updated to be able to deal with relative filenames if they exist.
2019-08-02 17:00:01 +02:00
Gustav Wikström 9865e6bd8b org-id: Speedup, minor functional change and fix
* org-id-update-id-locations

Major speedup and minor functionality change.  This function is more
predictable now since local open files are not considered.  Providing
files as arguments to the function does no longer override other
files.  They are instead seen as a complement.

* org-id-add-location

Don't add duplicates.

* org-id-hash-to-alist

Fixed function, previously didn't do its job correctly.
2019-08-02 15:35:19 +02:00
Nicolas Goaziou ff6508ad4b Bump Version keyword
* lisp/org.el: Bump Version keyword.

This is necessary for GNU ELPA. Ideally, such a change should be
tagged with the official release.
2019-08-02 09:55:53 +02:00
Carsten Dominik 4910bec3aa Bug fix for previous commit 2019-08-01 08:35:47 +02:00
Carsten Dominik 64739aa065 Implement force logging of a TODO state change
* lisp/org.el (org-todo): Make a tripple `C-u' prefix force
          logging the todo state change with timestamp and a note.
          Ignoting blocking a change now needs four `C-u' prefixes,
          because this is probably hardly ever used.

	* doc/org-manual.org (Tracking TODO state changes): Document
          forcing of state change logging with `C-u C-u C-u C-c C-t'.
2019-08-01 08:10:20 +02:00
Carsten Dominik 2d08e9d4be Merge branch 'master' of code.orgmode.org:bzg/org-mode 2019-07-27 22:04:06 +02:00
Carsten Dominik e413e7695c Keep brackets around capture link annotation, to protect spaces
2019-07-27  Carsten Dominik  <carsten.dominik@gmail.com>

	* lisp/org-capture.el (org-capture-fill-template): Keep [[]]
	around the %l link annotation.

When capture is called from a buffer and the template includes a %l
annotation, then this link needs to be enclosed in [[ ... ]].  The
default link is a search link that searches for the line at point -
and when the link contains whitespace, it needs to be part of the link.
2019-07-27 21:57:21 +02:00
Kyle Meyer 29f96ef1b7 Merge branch 'maint' 2019-07-23 23:25:05 -04:00
Kyle Meyer be47489c31 org-gnus: Add note about integer overflow guard
* lisp/org-gnus.el (org-gnus-follow-link): Add compatibility note to
code that guards against integer overflow.

Emacs's 7e294d55e1 (Remove some obsolete integer overflow handling,
2019-07-22) removes this, but we can't port that for compatibility
reasons.
2019-07-23 23:24:13 -04:00
Marco Wahl 09a15f4d7f org-agenda: Unify user interfaces for bulk action and tag filtering 2019-07-24 00:37:01 +02:00
Marco Wahl 669cbe4653 Merge remote-tracking branch 'origin/master' 2019-07-15 00:31:35 +02:00
Marco Wahl dc2198971b org-agenda: Respect narrowing for agenda restricted to buffer
* lisp/org-agenda.el (org-agenda): Add a condition to check if
  narrowing is in effect and in case set the agenda restriction markers.
* etc/ORG-NEWS (Respect narrowing when agenda command is restricted to buffer):
* doc/org-manual.org (The Agenda Dispatcher): Mention the behavior.
2019-07-15 00:22:51 +02:00
Nicolas Goaziou 6786fb2e31 Merge branch 'maint' 2019-07-15 00:00:25 +02:00
Marcin Borkowski 3b006f9a3e Fix a bug when `org-agenda-todo-ignore-deadlines` is set to t
* lisp/org-agenda.el (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
Make `t' synonymous with `near' instead of `all' (as is stated in the
docstring).
2019-07-14 23:59:55 +02:00
Kyle Meyer 57e254e67c Merge branch 'maint' 2019-07-14 11:14:54 -04:00
Ismail S 64262af685 Backport commit fb48eb48f from Emacs
* lisp/org-capture.el (org-capture-templates): Fix typo in doc
string (bug#36491).

Fix minor typo in org-capture-templates
fb48eb48f3bd432307821bc7158d1090f0e4bbf0
Ismail S
Tue Jul 9 00:53:18 2019 +0200

TINYCHANGE
2019-07-14 11:12:33 -04:00
Konstantin Kharlamov c0d699e9ba Backport commit dfc322d77 from Emacs
* lisp/org-mobile.el (org-mobile-copy-agenda-files)
(org-mobile-update-checksum-for-capture-file):
* lisp/org-table.el (org-table-number-regexp):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
(Bug#36167)

Replace manually crafted hex regexes with [:xdigit:]
dfc322d77fd1ce3aa4d852e0ff07bb36944f6432
Konstantin Kharlamov
Sat Jul 6 10:54:25 2019 +0300
2019-07-14 11:12:12 -04:00
Marco Wahl 63b9c2634e Merge branch 'master' into compact-folding-refinement 2019-07-13 23:21:12 +02:00
Marco Wahl d2a5a6e4d0 Make feature "show children" applicable to whole file
* lisp/org.el (org-ctrl-c-tab): Make function applicable to a whole
  file.  Further flag (aka hide) all content in the subtrees.
2019-07-13 22:30:02 +02:00
Marco Wahl fd63eee797 Make feature "show branches" applicable to whole file
* lisp/org.el (org-kill-note-or-show-branches): Extend and refactor.
2019-07-13 22:29:29 +02:00
Nicolas Goaziou 2c8e8b4a18 contrib: Remove Org Drill
* contrib/README:
* lisp/org.el (org-modules): Remove reference to Org Drill.
contrib/lisp/org-drill.el: Remove file.

Org Drill is now developed externally, and available through an
ELPA (MELPA at this point).
2019-07-11 22:55:02 +02:00
Marco Wahl ee4fcc2aaa Add function to show just every headline in buffer
* lisp/org.el (org-show-branches-buffer): New function.
2019-07-11 12:12:37 +02:00
Marco Wahl add2614cf9 Add function to flag region above first heading
* lisp/org.el (org-flag-above-first-heading): New function.
2019-07-11 12:08:47 +02:00
Nicolas Goaziou 1ff9cab0a3 Merge branch 'maint' 2019-07-09 12:43:29 +02:00
Nicolas Goaziou 9bde6350d1 ox: Add post-blanks when latex is verbatim
* lisp/ox.el (org-export--remove-uninterpreted-data): Add post-blanks
  when latex is verbatim.
2019-07-09 12:42:46 +02:00
Nicolas Goaziou fae13929f4 Merge branch 'maint' 2019-07-09 11:57:21 +02:00
Nicolas Goaziou d73f65b57a org-list: Fix wrong list indentation
* lisp/org-list.el (org-list-struct-indent): Small refactoring.
(org-list-indent-item-generic): Copy old structure so
`org-list-write-struct' can notice bullet change.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-07/msg00033.html>
2019-07-09 11:56:47 +02:00
Gustav Wikström ae9cd4370b org-attach*, org, org-manual, org-news, ox-html, testing/*
* lisp/org-attach.el

Changed the way attachments deal with property-inheritance.  It now
adheres to the =org-use-property-inheritance= setting by default but
it can be customized if needed (I recommend to enable it!).
The property ATTACH_DIR is deprecated in favour of the shorter and simpler
property DIR.

Added an explicit option to =org-attach= for unsetting
attachment-directories (i.e. remove DIR property and deal with the
attachments by interaction).

Added attachment link type with the prefix "attachment:".

Added customizations:
- org-attach-dir-relative
- org-attach-preferred-new-method
- org-attach-use-inheritance
- org-attach-id-to-path-function

Hooks added:
- org-attach-after-change-hook
- org-attach-open-hook

A new linktype "attachment" is added in order to reduce
link-duplication when wanting to link to files in attached folders of
nodes.  This works for both ID and DIR properties.  The goal is to
make the functionality for attachment links mirror the functionality
for file links.

* lisp/org-attach-git.el

New file, existing functionality.  Code here has been factored out
from org-attach.el and if GIT-functionality is to be used this module
needs to be required sepatately.  It extends org-attach by use of its
hooks.

Activating git functionality in org-attach is done by loading
org-attach-git from now on, instead of customizing a variable.

Naming of both functions and tests has been modified to match the move
of functionality into its own module.

* lisp/org.el

Inline images are shown also using attachment-links, exactly the same
as it works for file-links today.

Make org-open-at-point respect ARG when opening attachment-dir.

* lisp/org-compat.el

org-attach-directory has been deprecated in favour for
org-attach-id-dir.  The new name matches its purpose better.

* lisp/ox-html.el

Export attachment links to images as inline images, in the same way as
file links work today.

* etc/ORG-NEWS

Mention the changes in this patch.

* doc/org-manual.org

The chapter "Refile, Copy, Archive" has been split into two separate
chapters.
- "Refile, Copy and Archiving" for information related to moving
  existing data around.

- "Capture, Attachments, RSS Feeds and Protocols" for information
  related to working with external data.

The attachment-part has been rewritten and extended to match the
changes in this patch.

The new attachment link type is mentioned both inside the attachments
chapter and in the chapter dealing with links.

Documentation related to external links has been improved.

* testing/lisp/test-org-attach-annex.el

Require org-attach-git instead of org-attach, since this file tests
the GIT-functionality.

* testing/lisp/test-org-attach.el

Add tests for org-attach.

* testing/org-test.el

Define a symbol for a file to test attachments with.

* testing/examples/*

A bunch of new example files and folders are created and are used in
testing of org-attach to verify its functionality.
2019-07-07 19:55:49 +02:00
Nicolas Goaziou 0201d1c0cc Fix inserting capture templates at point
* lisp/org-capture.el (org-capture):
(org-capture-set-target-location):
(org-capture-place-entry):
(org-capture-place-item):
(org-capture-place-table-line): Fix inserting capture templates at
point.  Insert a new internal property for capture
template: :insert-here.
(org-capture-insert-template-here): Remove function.

* testing/lisp/test-org-capture.el (test-org-caputre/entry):
(test-org-capture/item):
(test-org-capture/table-line): Add tests.

Reported-by: Dominic Surano <sk8ingdom@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-07/msg00002.html>
2019-07-06 16:02:37 +02:00
Nicolas Goaziou 1b3c7c28cf Merge branch 'maint' 2019-07-06 10:25:18 +02:00
Nicolas Goaziou acf4f0881a org-agenda: Fix "Args out of range" error in `org-agenda-list'
* lisp/org-agenda.el (org-agenda-list): Do not add text properties on
empty headers.
2019-07-06 10:24:11 +02:00
Nicolas Goaziou b855acc878 Merge branch 'maint' 2019-06-28 17:50:53 +02:00
Nicolas Goaziou 7bc6f8d619 org-table: Prevent formula evaluation from widening all tables
* lisp/org-table.el (org-table-recalculate): When a formula is
  evaluated, do not expand shrunk columns across the whole buffer.
2019-06-28 17:49:25 +02:00
Nicolas Goaziou 9ddfe45314 org-table: Improve `org-table-copy-down'
* lisp/org-table.el (org-table--increment-field): New function.
(org-table-copy-down): Use new function.
* testing/lisp/test-org-table.el (test-org-table/copy-down): New test.
* doc/org-manual.org (Calculations): Update documentation.
2019-06-28 00:07:25 +02:00
Nicolas Goaziou 7e4847a554 Merge branch 'maint' 2019-06-28 00:06:58 +02:00
Nicolas Goaziou 0553f2e31c org-table: Fix `org-table-next-row' at eob
* lisp/org-table.el (org-table-next-row): Fix misbehaviour when called
  on the last row, at the end of the buffer, without a final newline.
2019-06-28 00:05:44 +02:00
Kyle Meyer 8e7280896f org-attach: Bind org-attach-method for org-attach-url
* lisp/org-attach.el (org-attach-url): Let-bind org-attach-method to
`url` so that org-attach-attach calls the correct method.

Before 72124726a (org-attach: Make dispatcher commands customizable,
2019-04-26), the dispatcher masked this issue by let-binding
org-attach-method around its call to org-attach-url.

Reported-by: stardiviner <numbchild@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2019-06/msg00130.html>
2019-06-21 18:15:52 -04:00
Aaron L. Zeng 1b74ae0ba3 org-clock: Clear org-clock-current-task on clock cancel
* org-mode/lisp/org-clock.el (org-clock-cancel): Clear
`org-clock-current-task' when a clock is canceled.

This variable is used by some mode line packages (e.g.,
spaceline-all-the-icons), so not clearing the variable incorrectly
displays the previous task as ongoing.
2019-06-15 11:53:42 +02:00
Nicolas Goaziou 439782ae00 Merge branch 'maint' 2019-06-12 18:22:50 +02:00
Thomas Plass 0d7d12ffe6 ox: Make `org-export-table-cell-alignment' more robust
* lisp/ox.el (org-export-table-cell-alignment): Make
`org-export-table-cell-alignment' handle tables with rows containing
unequal numbers of cells.

Patch modeled after previous fix for `org-export-table-cell-width'.

TINYCHANGE
2019-06-12 18:22:00 +02:00
Neil Jerram 85711ba3d9 Make capture's idea of the current day more intuitive 2019-06-10 11:20:20 +02:00
Nicolas Goaziou c30fe929cd Merge branch 'master' of code.orgmode.org:bzg/org-mode 2019-06-10 11:17:31 +02:00
Nicolas Goaziou 3ecf1fb7b9 ox: Silence byte-compiler
* lisp/ox.el (org-export-resolve-link): Use `org-link-make-string'
  instead of `org-make-link-string'.
2019-06-10 09:43:37 +02:00
Kyle Meyer 81920b3f86 Merge branch 'maint' 2019-06-09 21:39:18 -04:00
Paul Eggert 55e19d973e Backport commit 797ee5871 from Emacs
The convention is that a file with Author: but not Maintainer:
means the author is a maintainer, which makes it confusing
when a file lists the same person as author and maintainer.
Avoid the confusion by removing the duplicate Maintainer: line.

Remove Maintainer: when it duplicates Author:
797ee5871e458d6d97f57a24405412a053f5ef32
Paul Eggert
Sun May 26 01:00:15 2019 -0700
2019-06-09 21:28:44 -04:00
Paul Eggert 43bdc85b9d Backport commit 542443645 from Emacs
* lisp/org-id.el (org-id-link-to-org-use-id):
* lisp/org.el (org-support-shift-select, org-file-apps):
Remove backslash-newline that immediately precedes another
newline, as this is not the usual style and is confusing.

Avoid backslash-newline-newline in source code
5424436452bc0b3d8a62a8398f92d0c2db81e22b
Paul Eggert
Wed May 22 23:59:36 2019 -0700
2019-06-09 21:26:08 -04:00
Paul Eggert 96f439226e Backport commit bef1be873 from Emacs
Fixes for "Maintainer:" and related lines
bef1be873009d6e9f5a097396179f63a565bb6fd
Paul Eggert
Sun May 19 21:34:27 2019 -0700
2019-06-09 21:25:24 -04:00
Nicolas Goaziou 0ff65e9f4c org-list: Change `org-list-to-subtree' signature
* lisp/org-list.el (org-list-to-subtree): Add optional argument to
  specify level of the subtree.
(org-list-make-subtree):
* lisp/org.el (org-toggle-heading): Adapt to signature change.

Reported-by: Felix Wiemuth <felixwiemuth@hotmail.de>
<http://lists.gnu.org/r/emacs-orgmode/2019-06/msg00010.html>
2019-06-10 00:19:32 +02:00
Nicolas Goaziou bba9116cb8 org-element: Parse affiliated keywords according to granularity
* lisp/org-element.el (org-element--current-element): Parse affiliated
  keywords according to granularity.
* lisp/ox.el (org-export-get-caption): Refactor code.
* testing/lisp/test-org-element.el (test-org-element/affiliated-keywords-parser):
  Add tests.

Reported-by: ihor <ihor@antonovs.family>
<http://lists.gnu.org/r/emacs-orgmode/2019-06/msg00023.html>
2019-06-09 00:51:53 +02:00
Nik Clayton 380e2f7f82 ox-html: Include the line number as a data attribute
* lisp/ox-html.el (org-html-do-format-code): If line numbers are enabled
then include a data-ox-html-linenr attribute that contains this line's
line number.

This allows you to have more control over line number formatting and
placement. For example, the following CSS hides the span that contains
the line number, and uses a CSS :before property to position and format
the line number with a border instead of a semi-colon separating content
and line number.

span.linenr { display: none; }

code[data-ox-html-linenr]:before {
  content: attr(data-ox-html-linenr);
  display: inline-block;
  border-right: 1px solid;
  width: 1rem;
  text-align: right;
}

TINYCHANGE
2019-06-07 23:32:11 +02:00
Nik Clayton ded3d27b14 ox-html: Wrap each line of a source block in a code element
* lisp/ox-html.el (org-html-do-format-code): Wrap each line of a source block
in a code element.

This makes it straightforward to add custom decorations to each line
using CSS :before and :after properties.

TINYCHANGE
2019-06-07 23:32:08 +02:00
Nicolas Goaziou ba943ac855 ox-md: Silence byte compiler 2019-06-05 18:34:38 +02:00
Nicolas Goaziou 5832c8fc93 Fix `org-image-actual-width' behaviour
* lisp/org.el (org-image-actual-width): Improve docstring.
(org-display-inline-images): Ignore case when looking for ATTR
keywords.  Refactor code.

Reported-by: 'Ihor Radchenko' <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-06/msg00030.html>
2019-06-05 18:31:35 +02:00
Sacha Chua a41e9950ae Add :target option for the TOC keyword
* doc/org-manual.org, etc/ORG_NEWS: Document :target option
  for the TOC keyword.

* lisp/ox.el (org-export-resolve-link): New function.

* lisp/ox-ascii.el (org-ascii-keyword): Added :target to the TOC
  keyword.
  (org-ascii--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-html.el (org-html-keyword): Added :target to the TOC keyword.

* lisp/ox-md.el (org-md-keyword): Added :target to the TOC keyword.
  (org-md--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-odt.el (org-odt-keyword): Added :target to the TOC keyword.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Added
  tests for specifying scope by CUSTOM_ID or by fuzzy matching.
  (test-org-export/resolve-link): New test.
2019-05-30 15:25:46 +02:00
Nicolas Goaziou 99aa99426d Merge branch 'maint' 2019-05-30 14:59:58 +02:00