0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 10:32:52 +00:00
Commit graph

16294 commits

Author SHA1 Message Date
Anders Johansson 40474827ea org-num: Fix bug in check for commented headlines
* lisp/org-num.el (org-num--skip-value): Handle empty headlines.

This happens when org-num-skip-commented is non-nil.  When creating
a new headline, often org-num--skip-value is invoked before any
headline text is created. This means that ‘title‘ is nil and the
string-match check breaks. Checking if title is non-nil fixes this.

TINYCHANGE
2020-08-27 11:29:12 +02:00
Kyle Meyer cdfc404bed Merge branch 'maint' into master 2020-08-23 22:39:44 -04:00
Ihor Radchenko 7b657c50e7 org-clock.el: Fix calculated clocking sum in inlinetasks
* lisp/org-clock.el (org-clock-sum-current-item): Do not include
clocked time from the parent when inside inlinetask.

Calling `org-narrow-to-subtree' from inside inlinetask would narrow to
the parent's subtree (correct behaviour).  However, it is not what we
want when calculating the clocking sum.  Inlinetask case should be
treated specially.
2020-08-23 22:38:45 -04:00
Allen Li 76da93aa86 org.el: Don't exclude local tags that are also inherited
This fixes a bug in set-tags-command excluding a tag that is both set
locally and inherited from the initial minibuffer input by modifying
org-get-tags to prefer keeping the locally set tag over the inherited
tag, as this behavior is more intuitive for org-get-tags anyway.

* lisp/org.el (org-get-tags): Keep local tags over inherited.
* testing/lisp/test-org.el (test-org/set-tags-command): Add test.
2020-08-23 22:38:20 -04:00
Christian Vanderwall 312a646fb8 ob-python.el: Fix issue with sessions on remote machines
* lisp/ob-python.el (org-babel-python-evaluate-session): Process
temporary file name with `org-babel-process-file-name' before
inserting it into code Python code snippets.

Before this change, the entire temporary filename was sent to the
Python session for execution, causing a 'No such file' error when the
filename had a Tramp format such as
/ssh:user@server:/tmp/python-ABCDEF.

TINYCHANGE
2020-08-20 18:34:00 -07:00
Kyle Meyer 220f2b0d93 agenda: Fix a docstring's position
* lisp/org-agenda.el (org-agenda-remove-filter): Move docstring to
correct position.
2020-08-17 23:20:05 -04:00
Kyle Meyer 616672c2f3 Merge branch 'maint' into master 2020-08-17 00:12:30 -04:00
Benson Chu bd97851c47 org-clock.el: Update org-clock-out-time from org-resolve-clocks
* lisp/org-clock.el (org-clock-out): If `at-time' was passed, set
org-clock-out-time to that value. Otherwise, set it to now.

TINYCHANGE
2020-08-17 00:11:07 -04:00
Nicolas Goaziou f4687993c5 ox-latex: Fix links to files with name matching an image type
* lisp/ox-latex.el (org-latex-inline-image-rules): Ensure
caracterization happens on extension only.
2020-08-16 12:01:20 +02:00
Nicolas Goaziou 567662d5b0 list: Fix item insertion when split point is near blanks
* lisp/org-list.el (org-list-insert-item): Ignore blanks around cut
position.
* testing/lisp/test-org-list.el (test-org-list/insert-item): Add test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-08/msg00065.html>
2020-08-16 11:42:53 +02:00
Kyle Meyer 5417e384eb Merge branch 'maint' 2020-08-10 20:38:18 -04:00
Nicholas Vollmer ab9b14a80f org.el: (org-get-cursor-date): Fix regular expression
* lisp/org.el (org-get-cursor-date): Fix regular expression.

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

" 8:00......"
2020-08-10 20:35:36 -04:00
Kévin Le Gouguec 81e2948472 Fix org-fontify-whole-*-line by setting face extension (bug#42184)
* lisp/org-faces.el (org-block): Set background extension beyond
end-of-line.
* lisp/org-compat.el (org--set-faces-extend): New function to
temporarily (re)set :extend for Emacs≥27.
* lisp/org.el (org-mode): Call it to set the extend attribute of
relevant faces to the correct value.
2020-08-10 20:22:25 -04:00
John Herrlin ea946353aa ob-core: file-mode option in source code block arguments
* ob-core.el (org-babel-execute-src-block): Source code block header
argument `:file-mode' can set file permissions if `:file' argument is
provided.
(org-babel-common-header-args-w-values): Add `:file-mode' to common
header arguments.

TINYCHANGE
2020-08-02 22:59:25 -04:00
Kyle Meyer a103f3f3ee Merge branch 'maint' 2020-08-02 22:56:03 -04:00
Nicholas Vollmer 093b474e6a org-list: Operate on single line if no active region
* lisp/org-list.el (org-toggle-item): Operate on single line if no
active region.
2020-08-02 22:55:47 -04:00
Kyle Meyer df5a836375 ob-core: Call org-confirm-babel-evaluate with expanded noweb refs
* lisp/ob-core.el (org-babel-check-confirm-evaluate): Expand noweb
references in the body passed to org-confirm-babel-evaluate.
* testing/lisp/test-ob.el (test-ob/check-eval-noweb-expanded): New
test.

When noweb references are set to be expanded for evaluation,
org-confirm-babel-evaluate should receive the expanded body so that it
can make its decision based on what actually will be evaluated
(without resorting to calling org-babel-get-src-block-info itself).

Note that this results in up to three calls to
org-babel-expand-noweb-references.  Possible ways to avoid this are
discussed at the thread referenced below.

Reported-by: Tom Gillespie <tgbugs@gmail.com>
https://orgmode.org/list/CA+G3_PNi3uMvBiWgBdKuC3C6VJt1T1j-RKH43LRqYbr+4NS8ZA@mail.gmail.com/
2020-08-02 22:55:16 -04:00
Bassam Saeed b395f0abf6 ol.el: Fixed typo
* lisp/ol.el (org-link-parameters): Fixed typo 'ar' to 'are'

TINYCHANGE
2020-08-02 00:07:34 -04:00
Nicolas Goaziou 270aa438e2 Fix `org-show-children' error when called before first heading
* lisp/org.el (org-show-children): Fix `org-show-children' error when
called before first heading.
2020-07-27 19:22:46 +02:00
Kyle Meyer 82b496c0e9 Merge branch 'maint' 2020-07-22 23:33:07 -04:00
Leo Vivier c9abb4c29a org: Remove useless example in docstring
* lisp/org.el (org-find-olp): Remove useless example in docstring.

TINYCHANGE
2020-07-22 23:30:58 -04:00
Marco Wahl 7069dc3f32 org: New function to hide the body up to the first child
* lisp/org.el (org-hide-entry): New function. Counterpart to org-show-entry.
2020-07-21 12:14:10 +02:00
Kyle Meyer 05fac0b765 org-macs.el: Silence byte-compiler under 'make single' 2020-07-15 23:37:21 -04:00
Kyle Meyer 454131d228 ob-screen: Quote session name before passing to string-match
* lisp/ob-screen.el (org-babel-screen-session-socketname): Quote
session name before giving it to string-match because the name may
have regexp characters.

While touching the line, make two cosmetic tweaks.
2020-07-15 23:28:00 -04:00
Kenneth D. Mankoff 0ab117bc57 ob-screen: Accept :screenrc header argument
* lisp/ob-screen.el (org-babel-default-header-args:screen): Add
default header argument `:screenrc' and value "/dev/null".
(org-babel-prep-session:screen): Use header argument in variable
`screenrc' and not hard-coded value.
2020-07-15 23:13:44 -04:00
Kenneth D. Mankoff 25bc790be5 ob-screen: Respect :session name. Don't prepend 'org-babel-session-'
* lisp/ob-screen.el (org-babel-prep-session:screen): Remove concat of
"org-babel-session-" string onto session name when creating session.
(org-babel-screen-session-socketname): Remove concat of
"org-babel-session-" string onto session name searching for existing
screen session.
2020-07-15 23:13:44 -04:00
Kenneth D. Mankoff 68b7415146 ob-screen: Execute last line in block (send newline)
* lisp/ob-screen.el (org-babel-screen-session-write-temp-file): Insert
newline after body.
2020-07-15 22:51:46 -04:00
Nicolas Goaziou ddfc469a1a id: Fix error about `agenda-archives'
* lisp/org-id.el (org-id-update-id-locations): Default extra files
also include a special symbol.  Be sure to remove it before calling
`file-truename'.
2020-07-14 19:07:14 +02:00
Nicolas Goaziou 91b2398293 Do not fill paragraph before region
* lisp/org.el (org-fill-paragraph): Do not fill paragraph before
region.
* testing/lisp/test-org.el (test-org/fill-paragraph): Add test.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://lists.gnu.org/r/emacs-orgmode/2020-07/msg00164.html>
2020-07-14 11:46:38 +02:00
Alexandru-Sergiu Marton fe41103d50 ox: Add Romanian smart quotes
* lisp/ox.el (org-export-smart-quotes-alist): Add Romanian variants for
  smart quotes.

TINYCHANGE
2020-07-13 18:17:37 +02:00
Kyle Meyer 95eaab7f44 agenda: Fold case when retrieving user-configured effort values
* lisp/org-agenda.el (org-agenda-filter-by-effort):
(org-agenda-filter-completion-function): Ignore case when querying
effort property key in org-global-properties since property keys are
documented as case-insensitive.
2020-07-09 00:33:09 -04:00
Kyle Meyer eac255d911 Merge branch 'maint' 2020-07-08 00:12:06 -04:00
Kyle Meyer e62ca4a1bf org-attach: Fix :type for org-attach-use-inheritance
* lisp/org-attach.el (org-attach-use-inheritance): Drop repeated :type
keyword that incorrectly marked the option as boolean.

Reported-by: Philip Blagoveschensky <philip@crabman.me>
https://orgmode.org/list/7036d668-eb09-ba4d-0b46-503fbc4a50ce@crabman.me
2020-07-08 00:11:34 -04:00
Nick Dokos bc4fa8a008 org: add property names from #+PROPERTY keywords to completion list
* lisp/org.el (org-buffer-property-keys): Enhance the completion list
with property names from #+PROPERTY keywords, not just property
drawers. Also, for each xxx_ALL property, make sure that the bare xxx
property is added too.

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

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

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

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

This behavior allows to reveal invisible text before the first
heading.
2020-07-07 00:12:39 +02:00
Nicolas Goaziou 07a4a72862 list: Fix regression when inserting items
* lisp/org-list.el (org-list-insert-item): Fix splitting item.
* testing/lisp/test-org-list.el (test-org-list/insert-item): Add test.

Reported-by: Duianto - <otnaiud@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-07/msg00061.html>
2020-07-06 12:05:18 +02:00
Albert Krewinkel c78db89106 entities: rename section with eth and thorn to "Icelandic"
Eth and thorn are letters in the Icelandic alphabet, and the language
is in active use.

TINYCHANGE
2020-07-05 23:51:40 +02:00
Erik Hetzner ab80b26667 id: Fix behavior when `org-id-extra-files' is a symbol
* lisp/org-id.el (org-id-update-id-locations): When
`org-id-extra-files' is a symbol, it should be evaluated as a
variable.

In 9865e6bd8be65229be4eac4f459f62e47fab2be737a5020bb,
`org-id-update-id-locations' was rewritten, and the functionality to
allow the variable `org-id-extra-files' to be a symbol that references
another variable was removed.  This change restores that
functionality.
2020-07-05 23:47:51 +02:00
Marco Wahl cc570144f8 agenda: Call finalize-hook later
* lisp/org-agenda.el (org-agenda-finalize): Call the hooks after the
save-excursion.

This opens the way for hooks to position the cursor after agenda
generation.
2020-07-05 23:09:38 +02:00
Marco Wahl 4dc8b57786 Merge remote-tracking branch 'origin/maint' into maint 2020-07-04 12:54:39 +02:00
Marco Wahl 3327fbb6d4 Merge branch 'maint' 2020-07-04 12:51:53 +02:00
Marco Wahl 5427a74071 habit: Fix of the fix of color for very first done of a habit
* lisp/org-habit.el (org-habit-build-graph): Check if there is a done
date at all.

Reported by Colin Baxter, see https://orgmode.org/list/877dvjve9v.fsf@yandex.com/.

See f471768a5 for the related fix.
2020-07-04 12:44:13 +02:00
Nicolas Goaziou a3f01e183f Tweak drawer visibility after isearch
* lisp/org-macs.el (org-flag-region): Control visibility state after
an isearch.
* lisp/org.el (org-mode): Remove an unused variable.
2020-07-04 09:56:20 +02:00
Nicolas Goaziou e3745fac1e Remove `org-hide-drawer' text property leftovers
* lisp/org-macs.el (org-save-outline-visibility):
(org-invisible-p):
* lisp/org.el (org-show-set-visibility):
(org--forward-paragraph-once):
(org--backward-paragraph-once): Remove reference to `org-hide-drawer',
no longer used to hide drawers.
2020-07-03 21:50:46 +02:00
Kyle Meyer 86fada6b5d Merge branch 'maint' 2020-07-03 02:31:57 -04:00
Nicholas Vollmer 99b8f36ab8 capture: org-capture pass KEYS with GOTO arg
* lisp/org-capture.el (org-capture): Pass `keys' arg to
`org-capture-goto-target'.

Allows programmatically visiting a specific template.
2020-07-03 02:31:31 -04:00
Nicolas Goaziou 0c0d00b931 lint: Silence byte-compiler 2020-07-02 19:36:34 +02:00
Nicolas Goaziou b0bbe512b4 src: Do not undo edit buffers back to empty state
* lisp/org-src.el (org-src--edit-element): Clear undo information once
the initial contents have been inserted.
* testing/lisp/test-org-src.el (test-org-src/undo): New test.
2020-07-02 19:30:14 +02:00
mfrasca 73e367fca4 table: Allow collapsing header into single line
* lisp/org-table.el (org-table-collapse-header): New function.

* lisp/org-plot.el (org-plot/gnuplot): Use org-table-collapse-header
and trust there will be no more leading `hline' symbols in lisp table.

* testing/lisp/test-org-table.el (test-org-table/to-lisp):
Adding tests to already existing to-lisp function.
(test-org-table/collapse-header): Adding tests to new
collapse-header function.

* testing/lisp/test-ox.el (test-org-export/has-header-p): Testing
exporting table with multi-line header.
2020-06-28 23:02:26 +02:00
mfrasca 0c1740c919 org-plot: reducing complexity of test
* lisp/org-plot.el (org-plot/gnuplot): readability of test, looking
for some non satisfying elements.
2020-06-28 08:45:11 +02:00
Nicolas Goaziou 07ae5456b1 lint: Checking local files in links also include attachments
* lisp/org-lint.el (org-lint-link-to-local-file): Also check
attachment.
2020-06-28 08:44:11 +02:00
Nicolas Goaziou 5d427aefb4 ox-md: Fix docstring.
* lisp/ox-md.el (org-md--identity): Add missing full stop.
2020-06-28 08:44:11 +02:00
Kyle Meyer 15029c8abb Merge branch 'maint' 2020-06-28 02:29:12 -04:00
Kyle Meyer 3ed035ce3b org.el: Clarify argument in org-todo's call to org-map-entries
* lisp/org.el (org-todo): Use nil instead of
org-loop-over-headlines-in-active-region as the MATCH argument.

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

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

Reported-by: Mario Frasca <mario@anche.no>
https://orgmode.org/list/ea64d98c-d7bf-eea0-40d4-00a1515bdb98@anche.no
2020-06-28 02:13:58 -04:00
Kyle Meyer 3cbbbd784f Merge branch 'maint' 2020-06-27 00:03:29 -04:00
Kyle Meyer 591ea3eafb ox: Prevent dispatcher from starting in scrolled window
* lisp/ox.el (org-export--dispatch-ui): Restore buffer position after
inserting text to avoid auto-scrolling at start.

When filling in the dispatch buffer, point ends up at the end of the
buffer, which can cause the buffer to be re-centered on point when
org-fit-window-to-buffer is called, in particular if scroll-margin is
above zero and there is a vertical split.  Avoid this by putting point
where it was before the buffer was refreshed.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
https://orgmode.org/list/87tv3a56vv.fsf@gmail.com
2020-06-26 23:59:24 -04:00
Marco Wahl fe45a89aa1 Merge branch 'maint' 2020-06-26 13:17:28 +02:00
Marco Wahl f471768a54 habit: Fix color of habit for the very first done
* lisp/org-habit.el (org-habit-build-graph): Check if on the very
first "done" and set the standard color for done.

Recent behavior: Give that very first done the color to mean "done
ahead of schedule".
2020-06-26 13:09:50 +02:00
Nicolas Goaziou b76ed658f1 ox-html: Remove useless translator
* lisp/ox-html.el (html): Remove `footnote-definition' translator
since 1) it does not exist and 2) footnote definitions are translated
as part of of the inner template.
2020-06-23 15:51:06 +02:00
Nicolas Goaziou 83f5c6dcd8 ox-md: Correctly export elements converted as HTML
* lisp/ox-md.el (org-md--identity):
(org-md--convert-to-html): New functions.
(md): Use new functions. Transparently export drawers.

According to <https://www.markdownguide.org/basic-syntax/#html>,
contents of elements converted to HTML must also be converted to HTML.

Reported-by: Dominique Dumont <domi.dumont@free.fr>
<http://lists.gnu.org/r/emacs-orgmode/2020-06/msg00397.html>
2020-06-23 15:49:12 +02:00
Nicolas Goaziou fe7201f52a ox-md: Re-order internal functions 2020-06-23 15:34:48 +02:00
Marco Wahl 945f495b94 org: Enable join of multiple lines
* lisp/org.el (org-delete-indentation): Call delete-indentation via
the call-interactive wrapper to take into account a possibly selected
region.
2020-06-17 12:58:34 +02:00
Nicolas Goaziou e3a7247b68 table: Gracefully align hrule-only tables
* lisp/org-table.el (org-table-align): Try to align the table even
when it only consists of horizontal rules.
* testing/lisp/test-org-table.el (test-org-table/align): Add test.
2020-06-15 21:34:00 +02:00
Kyle Meyer a8cc4f7244 Merge branch 'maint' 2020-06-13 15:18:12 -04:00
Kyle Meyer ba6ca79af5 org.el: Fix #+end_src fontification error
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Rewrite the "line
begins with *" check so that it does not assume that match data has
remained intact.

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

Reported-by: John Ciolfi <ciolfi@mathworks.com>
<r9r1ulpctz.fsf@ah-ciolfi-lah-ciolfi-l.dhcp.mathworks.com>
2020-06-13 15:17:58 -04:00
Nicolas Goaziou c709187173 Do not widen when folding all drawers
* lisp/org.el (org-cycle-hide-drawers): Do not widen drawer.
2020-06-13 17:51:30 +02:00
Leo Vivier 325922c606 org-element: Update docstring
* org-element.el (org-element-keyword-parser): Mention that `keyword'
is normalized by being upcased.
2020-06-13 17:32:07 +02:00
Nicolas Goaziou e2b62b4da8 Rewrite org-forward-paragraph' and org-backward-paragraph'
* lisp/org.el (org-forward-paragraph):
(org-backward-paragraph): Rewrite functions.  Add repeat argument.
Mimic more closely regular `forward|backward-paragraph' functions.
(org--forward-paragraph-once):
(org--backward-paragraph-once):
(org--paragraph-at-point): New functions.
* testing/lisp/test-org.el (test-org/forward-paragraph):
(test-org/backward-paragraph): Update tests.  Add some.

Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
2020-06-13 17:22:48 +02:00
Kevin Liu 6882478cac capture: Fix org-capture-place-entry narrow bounds
* lisp/org-capture.el (org-capture-place-entry): Prevent breaking the
following headline inside the capture buffer.  This should match the
behavior from 9.3.
(org-capture-finalize): Reverts cb2774d1a, which solves a similar
problem but only in the finalize stage, so the subtree structure would
still be broken in the middle of editing the capture.
2020-06-13 10:47:21 +02:00
Nicolas Goaziou 688284043c lint: Prevent a false positive
* lisp/org-lint.el (org-lint-deprecated-header-syntax): DIR property
is also meaningful in attachments, so don't warn about header-args
prefix.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-06/msg00270.html>
2020-06-12 23:57:37 +02:00
Kyle Meyer aa32f65f83 Rename org-startup-numeroted variable to fix typo
* lisp/org.el (org-startup-numerated): Fix "numeroted" typo in
variable name.
(org-startup-options):
(org-mode):
* doc/org-manual.org (Dynamic Headline Numbering):
(Summary of In-Buffer Settings): Update for rename.

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

No compatibility alias has been added, as this variable hasn't yet
made it into a release.
2020-06-11 17:55:50 -04:00
Nicholas Vollmer 3ba4f056d7 capture: Set org-capture-current-plist' before org-capture-mode-hook'
* org-capture.el (org-capture-place-template): Allow
`org-capture-current-plist' access during `org-capture-mode-hook'

Ensure consistency between org-capture's hooks.

`org-capture-after-finalize-hook' is now the only hook that cannot
access `org-capture-current-plist' because the capture buffer is
killed when it is run.
2020-06-10 19:41:35 +02:00
Leo Vivier efd714d722 org-element.el: Update comment
* lisp/org-element.el (org-element-normalize-contents): Update comment

The comment mentions that caching for `org-elements' is enabled by
default, but this isn’t the case anymore since
bbdecd1e64, cf. `org-element-use-cache'.
2020-06-10 19:40:27 +02:00
Jack Kamm 3cec17cde5 ob-python.el: Fix multiline strings in non-session :results value
* lisp/ob-python.el (org-babel-python-evaluate-external-process): Use
functions from python.el to indent lines, avoiding multiline strings.
* testing/lisp/test-ob-python.el (test-ob-python/multiline-var): Set
test as expected to succeed.
(test-ob-python/multiline-str): Add test for multiline string in body.
(test-ob-python/header-var-assignment): Test that :var is in correct
scope and can be assigned to.

cf. https://orgmode.org/list/87tv009l9a.fsf@gmail.com/#t
2020-06-09 21:01:12 -07:00
Kyle Meyer 8d731ad256 Merge branch 'maint' 2020-06-08 20:28:03 -04:00
Kyle Meyer 3ebee03310 ob-tangle: Restore handling of relative file links
* lisp/ob-tangle.el (org-babel-tangle-single-block): Fix regression
from v9.0.2 that resulted in org-babel-tangle-use-relative-file-links
being ignored.
* testing/lisp/test-ob-tangle.el
(ob-tangle/comment-links-relative-file): Add test.

As of 7b148e2d0 (ob-tangle: Respect buffer local variables,
2016-12-10), the condition in org-babel-tangle-single-block that
checks whether to return a file link with a relative target always
returns nil because the full org-link-types-re match, including the
final colon, is compared with "file" (no colon).  Also, were this
condition to succeed, "file:" would be used as the file name.

Adjust the condition and fix the extracted file name.

Reported-by: Jeremias Gonzalez <jgonzalez49@ucmerced.edu>
https://orgmode.org/list/6fb12326-52d3-7177-eff5-62603261b388@ucmerced.edu
2020-06-08 20:25:22 -04:00
Lockywolf 0eeee1a04a ob-scheme.el: Add support for `geiser-scheme-implementation'
* lisp/ob-scheme.el (geiser-scheme-implementation)
(org-babel-execute:scheme): Add support for geiser scheme
implementation.

TINYCHANGE
2020-06-08 10:46:08 +02:00
Nicolas Goaziou 1aa095ccf1 Fix drawer invisibility
* lisp/org.el (org-cycle-hide-drawers): Move back from "org-compat.el"
(org-cycle-hook):
(org-show-entry):
(org-set-startup-visibility):
(org-clean-visibility-after-subtree-move):
(org-sort-entries): Use `org-cycle-hide-drawers'.
(org-log-beginning):
(org--hide-wrapper-toggle):
(org-hide-drawer-all): Use `outline' invisibility spec for drawers.
(org-show-all): Rewrite taking into account drawers now have the same
invisibility spec as headlines.
(org-overview):
(org-content):
(org-tree-to-indirect-buffer): Use fast arguments for `org-show-all'.
(org-mode): Remove `org-hide-drawer' invisibility spec.
* lisp/org-compat.el (org-flag-drawer): Use `outline' for drawer
invisibility.
(org-cycle-hide-drawers): move back to "org.el".
* lisp/org-clock.el (org-clock-find-position): Use `outline' for
invisibility spec.
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Use
`org-cycle-hide-drawers'.
2020-06-06 17:01:21 +02:00
Nicolas Goaziou 8fd24c0a53 ox-texinfo: Tiny refactoring
* lisp/ox-texinfo.el (org-texinfo-link): Use
`org-texinfo--sanitize-content'.
2020-06-05 15:57:15 +02:00
Bastien Guerry 99defa1959 ox-texinfo.el: Fix escaping special chars in raw-path
* lisp/ox-texinfo.el (org-texinfo-link): Escape @, { and }
characters in the link path.
2020-06-05 14:51:04 +02:00
Bastien Guerry 706970efb1 ox-texinfo.el: Fix escaping special chars in raw-path
* lisp/ox-texinfo.el (org-texinfo-link): Escape @, { and }
characters in the link path.
2020-06-05 14:50:27 +02:00
Nicolas Goaziou b4e379846e Do not insert unwanted TAB characters in some places
* lisp/org.el (org-indent-line): Do not return `noindent'.

Returning `noindent' is not synonymous to "no indentation change
needed".  In particular, `noindent' triggers insertion of
TAB-character, ignoring `tab-always-indent' value.
2020-06-05 14:06:35 +02:00
Bastien Guerry c7a86a43ae Merge branch 'maint' 2020-06-05 10:40:14 +02:00
Bastien Guerry fa4dddf8d2 Fix broken links
* lisp/org.el:
* lisp/ol-bibtex.el:
* etc/ORG-NEWS (org-capture.el is now the default capture system):
* doc/org-manual.org (Cache results of evaluation): Fix broken links.
2020-06-05 10:39:52 +02:00
Pierre Téchoueyres c631afd358 ox-html.el: Fix read-only error when export src block
When the type of src block involve an read-only buffer (ex:
compilation mode) avoid to setup the temp buffer as read-only and
error when processing it.

* lisp/ox-html.el (org-html-fontify-code): Set `inhibit-read-only' to
avoid read-only temp buffer.
2020-06-05 00:31:23 -04:00
Nicolas Goaziou b68090e0be Another fix to `org-next-visible-heading'
* lisp/org.el (org-next-visible-heading): There is no guarantee that
a `outline' overlay begins on the same line as a headline.
* testing/lisp/test-org.el (test-org/previous-visible-heading): New
test.

Reported-by: Kevin Liu <kevin@nivekuil.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-06/msg00092.html>
2020-06-04 16:08:40 +02:00
Nicolas Goaziou c6738fcf5d Silence byte-compiler 2020-06-03 16:52:20 +02:00
Nicolas Goaziou 8483b27c28 Merge branch 'maint' 2020-06-01 22:11:36 +02:00
Nicolas Goaziou 2c980de073 Prevent one-char invisible overlay at end of buffer
* lisp/org.el (org-cycle-internal-local): Do not create a one
character overlay at the end of buffer.
2020-06-01 22:07:01 +02:00
stardiviner 758b039c04 fix 5f0a9cca3 missing space
* lisp/ob-core.el (org-babel-demarcate-block): Replace wrong newline
with missing space.
2020-06-01 15:50:19 +02:00
Nicolas Goaziou f6c29730b3 Silence byte-compiler
* lisp/org.el (org-next-visible-heading): Remove unused binding.
2020-06-01 15:22:35 +02:00
Nicolas Goaziou d391364ac9 Merge branch 'maint' 2020-06-01 15:16:01 +02:00
Nicolas Goaziou b908367b03 ox-latex: Fix coderef links with special characters
* lisp/ox-latex.el (org-latex-link): Properly resolve coderefs with
special characters.

Reported-by: Vincent Picaud <picaud.vincent@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-06/msg00004.html>
2020-06-01 15:15:15 +02:00
Bastien efc12142b7 Revert "New function org-agenda-filter-set"
This reverts commit e9b1b8fde5.
2020-06-01 14:52:47 +02:00
Bastien 9092c289b6 Bind `org-force-cycle-archived' to C-c C-TAB
* lisp/org-keys.el (org-mode-map): Bind `org-force-cycle-archived'
to C-c C-TAB instead of C-TAB to avoid conflict with native Emacs
keybinding.

* doc/org-manual.org (Internal archiving): Update a keybinding.
2020-06-01 14:39:28 +02:00
Nicolas Goaziou fe7830b4f3 Merge branch 'maint' 2020-05-31 13:57:05 +02:00
Nicolas Goaziou 65fdf2be16 Fix `org-mark-element' in narrowed buffers
* lisp/org.el (org-mark-element): Do not set mark past narrowed part
of the buffer.
* testing/lisp/test-org.el (test-org/mark-element): New test.

Reported-by: Kevin Liu <kevin@nivekuil.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00812.html>
2020-05-31 13:55:47 +02:00
Nicolas Goaziou 1596113512 Fix `org-next-visible-heading'
* lisp/org.el (org-next-visible-heading): Fix function when
`org-cycle-separator-lines' is different from 0.
* testing/lisp/test-org.el (test-org/next-visible-heading): New test.
2020-05-31 12:55:08 +02:00
Kévin Le Gouguec 6506ea1e05 Coerce symbols found in :includes header arguments to strings
Fix regression from 2020-05-24T16:23:26Z!brandon@guttersohn.org
(commit 44cb98fdb), which broke test ob-C/string-var.

* lisp/ob-C.el (org-babel-C-expand-C): Make sure items in :includes
arguments are strings before performing string operations on them.
2020-05-28 22:32:30 -04:00
Jack Kamm d73fd145c0 ob-python.el: Revert fix for multiline var
* lisp/ob-python.el (org-babel-execute:python,
org-babel-python-evaluate): Move variable assignment back to body from
preamble.
* testing/lisp/test-ob-python.el (test-ob-python/multiline-var): Mark
unit test for multiline-variable as expected to fail.

Reverts 6149b6cb6 which fixed multiline vars in ob-python, but caused
a new bug (https://lists.gnu.org/archive/html/emacs-orgmode/2020-05/msg00719.html).
2020-05-28 07:29:31 -07:00
Nicolas Goaziou 516c038e5f lint: Catch misleading drawers within drawers
* lisp/org-lint.el (org-lint-incomplete-drawer): Catch misleading
drawers within drawers.
* testing/lisp/test-org-lint.el (test-org-lint/incomplete-drawer): Add
test.
2020-05-27 14:55:04 +02:00
Nicolas Goaziou b51d129f3f src: Fix typo
* lisp/org-src.el (org-edit-latex-fragment): Fix typo.
2020-05-26 23:09:52 +02:00
TEC f5c47d857c Extend org-edit-special to editing LaTeX fragments
* lisp/org-src.el (org-src--contents-area): Handle `latex-fragment'.
(org-edit-latex-fragment): New function.
* lisp/org.el (org-edit-special): Use new function.
2020-05-26 23:03:11 +02:00
Nicolas Goaziou 5454312dbf Merge branch 'maint' 2020-05-25 12:37:44 +02:00
Nicolas Goaziou 784054bc94 src: Replace newline with blanks when editing inline source code
* lisp/org-src.el (org-edit-footnote-reference): Do not remove newline
completely.
2020-05-25 12:36:35 +02:00
Bastien 5f0a9cca3d lisp/ob-core.el: Use lower-case by default for block keywords
* lisp/ob-core.el (org-babel-demarcate-block): Use lower-case
by default.
2020-05-25 11:51:57 +02:00
Roland Coeurjoly 1837cfb0e2 ob-haskell: Introduce :compile header argument
* lisp/ob-haskell (org-babel-haskell-compiler):
(org-babel-header-args:haskell): New variables.
(org-babel-haskell-execute):
(org-babel-haskell-interpret): New functions.
(org-babel-execute:haskell): Use new functions.
2020-05-25 09:17:14 +02:00
Nicolas Goaziou 266ad1e134 list: Fix cycle indentation
* lisp/org-list.el (org-cycle-item-indentation): Do not stop at
initial indentation before outdenting items.  Implement more robust
algorithm.
* testing/lisp/test-org-list.el (test-org-list/cycle-item-identation):
New test.
* testing/lisp/test-org-list.el (test-org-list/move-item-down): Small
reformatting.

Reported-by: lamaglama@posteo.net
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00573.html>
2020-05-24 23:43:24 +02:00
Brandon Guttersohn 44cb98fdb6 lisp/ob-C.el: Small fix to include expansion
* lisp/ob-C.el (org-babel-C-expand-C): When expanding include
directives, wrap filenames in quotes if they do not begin with "<".

TINYCHANGE
2020-05-24 18:23:26 +02:00
Kyle Meyer 14878f3f9a ob-core: Display warning on failure to read results
* lisp/ob-core.el (org-babel-import-elisp-from-file): Show handled
errors with display-warning rather than a message because the latter
is quickly overridden by subsequent messages, making it difficult if
not impossible for the user to spot.

The scope of the save-window-excursion call would need to be reduced
for the display-warning buffer to be shown, but nothing appears to
change the window configuration, so just drop the
save-window-excursion call.

Reported-by: Greg Minshall <minshall@umich.edu>
<2449663.1588516024@apollo2.minshall.org>
2020-05-24 11:56:43 -04:00
Jack Kamm 6149b6cb6d ob-python.el: Assign variables in preamble instead of body
* lisp/ob-python.el (org-babel-execute:python): Add variable
assignment to preamble instead of body.
(org-babel-python-evaluate): Concatenate preamble (which now includes
variable assignment) to body before session evaluation.

Fixes
https://lists.gnu.org/archive/html/emacs-orgmode/2020-03/msg00126.html. For
non-session evaluation, ob-python adds indentation to the body inside
main(), but this was adding spurious indentation for multiline strings
passed through :var. This commit fixes the issue by moving variable
assignment out of the body and into the preamble.
2020-05-24 07:49:22 -07:00
Bastien d9fe6aeafe lisp/ob-R.el: Don't throw an error when result cannot be parsed
* lisp/ob-R.el (org-babel-R-process-value-result): When the result
cannot be parsed, return an error as the output.

Thanks to Greg Minshall for reporting this.
2020-05-24 16:08:52 +02:00
Kevin J. Foley 010d1e3b6e Fix `org-babel-detangle' handling of false positives
* lisp/ob-tangle.el (org-babel-detangle): Handle false positive
matches of `org-link-bracket-re'.

* testing/examples/babel.el: New file for Babel detangle false
positive test.

* testing/examples/babel.org (detangle): Add detangle/false positive
example.

* testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive):
Add test for detangle false positive.
2020-05-24 15:40:21 +02:00
Bastien 6f113a5392 Merge branch 'maint' 2020-05-24 14:26:30 +02:00
Bastien b614ed0bba lisp/org-agenda.el: Remove redundant code
* lisp/org-agenda.el (org-agenda-get-some-entry-text)
(org-agenda-finalize): Remove redundant code: the 'org-link face
is already set by `org-activate-links'.

Thanks to Kevin Liu for reporting this.
2020-05-24 14:25:56 +02:00
Bastien 701c7bed94 lisp/org.el: Minor docstrings enhancements
* lisp/org.el (org-deadline, org-schedule): Update docstrings by
mentioning the use of the Emacs calendar.

See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15598
2020-05-24 10:13:52 +02:00
Bastien 6d62c76d2c ol.el: Allow to remove the link part of a link
* lisp/ol.el (org-link-make-string): When trying to make a link
with an empty link part, do not throw an error, just insert the
description text.
2020-05-23 17:07:35 +02:00
Stefan Kangas e9b1b8fde5 New function org-agenda-filter-set
* lisp/org-agenda.el (org-agenda-filter)
(org-agenda-filter-set): Refactor out from 'org-agenda-filter', to
create a better interface to filter the agenda from Lisp.
2020-05-23 11:06:54 +02:00
Bastien d8dae655f4 lisp/ol-bbdb.el: Tiny formatting enhancements 2020-05-23 10:32:43 +02:00
Bastien 5adfb533ce org.el: Tiny fixes in comments 2020-05-22 18:50:13 +02:00
fpi 928e67df7e org-protocol: Allow slashes after sub-protocol
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol):
Handle URIs with additional slashes before the start of the query
string, e.g. "org-protocol:/capture/?template=..." instead of
"org-protocol:/capture?template=...", as neede for some browsers.

TINYCHANGE
2020-05-22 17:54:41 +02:00
Bastien a75f440942 Merge branch 'maint' 2020-05-22 16:08:33 +02:00
Ivan Sokolov 47b653450f ob-js.el: Fix obsolete requirement
* lisp/ob-js.el (org-babel-js-function-wrapper): Fix obsolete
requirement.

TINYCHANGE
2020-05-22 16:07:55 +02:00
Bastien 7c913d1792 lisp/org-compat.el: Small fix in a "obsolete" declaration
* lisp/org-compat.el (org-cycle-hide-drawers): Mention to use
`org-hide-drawer-all' instead of `org-hide-drawer' as the latter
function does not exist anymore.
2020-05-22 16:03:44 +02:00
Paul Eggert 1e3184964c Backport commit 00be23c2a from Emacs
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Don’t try to modify string constants.

Don’t attempt to modify constant strings
00be23c2af4aa1bb09afc6404c5ef68997dc18f5
Paul Eggert
Sun May 17 16:51:46 2020 -0700
2020-05-21 20:51:38 -04:00
Kyle Meyer bfc4569ae3 Merge branch 'maint' 2020-05-20 23:00:40 -04:00
Kyle Meyer 5e2490bdf2 agenda: Respect FILETAGS when skipping archive entries
* lisp/org-agenda.el (org-agenda-skip): Consider skipping all entries
in a file if org-archive-tag is set via FILETAGS.

Reported-by: George Sokolsky <sokolgeo@posteo.net>
<87pnb4i217.fsf@posteo.net>
2020-05-20 22:47:42 -04:00
Kyle Meyer 962b8e765c org.el: Fix regression in collecting empty-value keywords
* lisp/org.el (org--collect-keywords-1): Don't replace space-only
values with nil because that leads to the option's default being used.
* testing/lisp/test-ox.el (test-org-export/get-inbuffer-options):
Add test.

This restores the behavior to what it was before b4e91b7e9 (New
function: org-collect-keywords, 2020-04-26).

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<CAFyQvY2ZGJPv=Ajx2_1xR0otv=VQYHcrUwzS46PmnyJ2Co1KVg@mail.gmail.com>
2020-05-19 20:33:15 -04:00
Nicolas Goaziou 9bc0cc7fb3 crypt: Allow nil value for `org-crypt-key'
* lisp/org-crypt.el (org-crypt-key): Allow nil value.
(org-crypt-key-for-heading): Handle nil value for `org-crypt-key'.
2020-05-17 00:04:35 +02:00
Nicolas Goaziou 5441b2d5ca crypt: Add autoloads, cleanup headers and requires 2020-05-17 00:04:35 +02:00
Nicolas Goaziou d3c15e2b34 crypt: Small improvements
* lisp/org-crypt.el (org-crypt--encrypted-text): New function.
(org-at-encrypted-entry-p): Better return value and more thorough
checks.
(org-encrypt-entry):
(org-decrypt-entry): Use new function.  Better handling of indented
crypted text, and folding.
2020-05-17 00:04:35 +02:00
Mak Kolybabi 18d37e5803 ox-md: Fix docstring
* lisp/ox-md.el (org-md-link): Fix docstring.
2020-05-16 20:45:31 +02:00
Nicolas Goaziou 8e6fb13a48 clock: Generate clock report with archives in indirect buffers
* lisp/org-clock.el (org-dblock-write:clocktable): Get archives from
original buffer, not from indirect one.

Reported-by: Alois Janíček <janicek.dev@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00282.html>
2020-05-16 20:42:01 +02:00
Nicolas Goaziou 12275cc9fe ox-html: Fix URI for LaTeX fragments
* lisp/ox-html.el (org-html-latex-environment):
(org-html-latex-fragment): Use `org-export-file-uri' to write proper
URI.

Reported-by: bpanthi <bpanthi977@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00271.html>
2020-05-16 19:28:59 +02:00
Nicolas Goaziou 93c50e3a78 Speed-up `org-(next|previous)-visible-heading
* lisp/org.el (org-next-visible-heading): Do not stop at every
invisible heading.
(org-previous-visible-heading): Use `org-next-visible-heading'.
2020-05-15 23:48:48 +02:00
Stanley Jaddoe bbf9c062a4 ox: Add Dutch translations
* lisp/ox.el (org-export-dictionary): Add missing Dutch (nl) translations.

TINYCHANGE
2020-05-15 21:53:06 +02:00
Nicolas Goaziou 7939da783e crypt: Fix crypting with multiple keys
* lisp/org-crypt.el (org-crypt-key): Improve docstring accuracy.
(org-encrypt-string): Remove function.
(org-crypt-key-for-heading): Correctly handle `epa-file-encrypt-to'
value.  Really return nil for symmetric encryption.
(org-encrypt-entry): Inline removed function. Tiny refactoring.
2020-05-15 16:56:57 +02:00
Nicolas Goaziou 99bb514f7f Follow links with RET even in read-only buffers
* lisp/org.el (org-return): Fix `interactive' arguments.
* testing/lisp/test-org.el (test-org/return): Add test.

Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00247.html>
2020-05-14 23:28:10 +02:00
Nicolas Goaziou 37a5020bbe id: Faster `org-id-update-id-locations'
* lisp/org-id.el (org-id-update-id-locations): Do not copy contents of
files in order to parse them.
2020-05-14 22:56:29 +02:00
stardiviner 1abf4f600a pcomplete: improve header arguments completion
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src): Make it
complete all available header arguments.

* testing/lisp/test-org-pcomplete.el (test-org-pcomplete/src-block):
New test.
2020-05-14 14:52:30 +02:00
Jonas Bernoulli 71604cbc2d Fix typos 2020-05-13 23:27:49 -04:00
Nicolas Goaziou 3dc582c8d5 list: Tiny fix to a docstring
* lisp/org-list.el (org-sort-list): Remove escaped parenthesis.
2020-05-13 19:10:35 +02:00
Nicolas Goaziou c76bacc483 ob: Ignore RESULTS keyword case
* lisp/ob-core.el (org-babel-current-result-hash):
(org-babel-hide-hash):
(org-babel-hide-all-hashes):
(org-babel-result-hide-all):
(org-babel-hide-result-toggle-maybe):
(org-babel-hide-result-toggle):
(org-babel--clear-results-maybe):
(org-babel-remove-result): Bind `case-fold-search' to t before looking
for `org-babel-result-regexp'.
2020-05-13 18:13:18 +02:00
Nicolas Goaziou 89c759f3ad ob: Replace angle brackets with parenthesis in Babel hashes
* lisp/ob-core.el (org-babel-hash-show-time): Remove
unnecessary :version keyword.
(org-babel-result-regexp):
(org-babel--insert-results-keyword): Remove angle brackets from time
stamp in hash.
* testing/lisp/test-ob.el (test-ob/where-is-src-block-result): Update
test.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00198.html>
2020-05-13 15:35:56 +02:00
Kyle Meyer 4349402f3f Merge branch 'maint' 2020-05-12 22:47:05 -04:00
Kyle Meyer 7684b59c78 colview: Display active time stamps as inactive
* lisp/org-colview.el (org-columns--displayed-value): Convert active
time stamp values to inactive time stamps to avoid duplicate entries
in the agenda.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add
tests.
2020-05-12 22:44:57 -04:00
Stacey Marshall 1228b73313 org-capture: Allow for no file extension on open-source protocol
* lisp/org-capture.el (org-protocol-open-source): Remove requirement
to have :online-suffix and :working-suffix.

The problem here was that two assignments expected suffix's to be
provided in org-protocol-project-alist.  When they were missing an
error occurred.  With the changes source URLs that include the file
name as-is, such as those presented by openGrok, may be opened.

TINYCHANGE
2020-05-12 16:40:26 +02:00
Nicolas Goaziou 88f5ed91c5 org-startup-folded' defaults to showeverything'
* lisp/org.el (org-startup-folded): New default value.

See <http://lists.gnu.org/r/emacs-orgmode/2020-04/msg00452.html>.
2020-05-12 12:33:21 +02:00
Nicolas Goaziou 20c1322194 Small fix in `org-cycle-hide-property-drawers'
* lisp/org.el (org-cycle-hide-property-drawers): Ignore case when
looking for the end of a property drawer.
2020-05-10 23:55:12 +02:00
Nicolas Goaziou 7801e92369 Merge branch 'maint' 2020-05-10 14:54:36 +02:00
Yuri D. Lensky 3bbaca1660 ob-latex: Stop ignoring headers argument
lisp/ob-latex.el: During default "png" export, the "headers" argument
is no longer explicitly ignored.
2020-05-10 14:53:11 +02:00
Nicolas Goaziou 20f0299bc3 ox-latex: Do not center images in image links
* lisp/ox-latex.el (org-latex--inline-image): Do not center image when
it is the description of a link.

Reported-by: Arne Babenhauserheide <arne_bab@web.de>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00157.html>
2020-05-10 14:43:40 +02:00
Nicolas Goaziou 6076f40cae Better checks to avoid re-hiding folded drawers
* lisp/org.el (org-hide-drawer-all): Hide regular drawers even in
folded headlines.  They do not use the same invisibility spec.
However, when the heading is folded, still ignore property drawers.
(org-cycle-hide-property-drawers): Only skip property drawers folded
with or inside `outline' overlays.
2020-05-10 11:14:40 +02:00
Nicolas Goaziou eabc9712b7 Fix code typo.
* lisp/org.el (org-cycle-hide-property-drawers): Fix code typo.
2020-05-10 10:46:21 +02:00
Kyle Meyer af3def5d06 Silence recent 'make single' compiler warnings
And remove the org-return-indent declaration in org-keys.el, which is
not needed as of d3e6b5800 (Make RET and C-j obey
`electric-indent-mode', 2020-05-05).
2020-05-09 22:36:00 -04:00
Nicolas Goaziou 1bf2b33e27 Refactor `org-global-cycle'
* lisp/org.el (org-global-cycle): Small refactoring. Always assume
`org-mode' as major mode.  Show all is not necessary.
2020-05-10 02:22:19 +02:00
Nicolas Goaziou a9ba5dc2dc Fix `org-content'
* lisp/org.el (org-content): Use Org function instead of Outline's for
a small speed-up. Properly handle numeric argument.
2020-05-10 02:20:52 +02:00
Nicolas Goaziou f1c0f34772 Small speed-up to `org-overview'
* lisp/org.el (org-overview): Use direct Org function instead of
Outline's for a slight speed-up.
2020-05-10 02:19:43 +02:00
Nicolas Goaziou c744d3cf4c Do not fold drawers hidden inside folded blocks
* lisp/org.el (org-hide-drawer-all):
(org-cycle-hide-property-drawers): Do not fold invisible drawers,
ignoring the type of invisibility spec.
2020-05-09 23:41:39 +02:00
Kyle Meyer b0fb4599c7 Merge branch 'maint' 2020-05-09 15:54:44 -04:00
Matt Lundin 6e50b22ff0 Fix bug that placed cursor incorrectly when setting tags
* lisp/org.el (org-set-tags-command): Only fix cursor position in very
specific circumstances (i.e., when cursor is on an empty headline).
* testing/lisp/test-org.el (test-org/set-tags-command): Add tests
related to point position.

Modified-by: Kyle Meyer <kyle@kyleam.com>
  Adjusted for review comments and added tests.
2020-05-09 15:50:37 -04:00
Nicolas Goaziou e73732f14a compat: Silence byte-compiler
* lisp/org-compat.el (org-cycle-hide-drawers): Ignore optional
argument.
2020-05-09 19:10:47 +02:00
Nicolas Goaziou 92bc33287e Do not fold property drawers in already folded areas
* lisp/org.el (org-cycle-hide-property-drawers): Do not re-fold
drawer.
2020-05-09 19:09:39 +02:00
Nicolas Goaziou 76f5cbd5a5 Properly hide new property drawers
* lisp/org.el (org-insert-property-drawer): Fix typo.
2020-05-09 18:56:34 +02:00
Nicolas Goaziou 3435b05922 Do not move point when cycling subtree visibility
* lisp/org.el (org-cycle-hide-property-drawers): Fix a bug introduced
in 1027e02569.
2020-05-09 18:35:11 +02:00
Kyle Meyer 86ec470bfc Correct :package-version typo from 1027e0256
* lisp/org.el (org-cycle-hook): Fix recent typo in package-version
value.
2020-05-09 11:14:46 -04:00
Nicolas Goaziou 074ea1629c Deprecate `org-cycle-hide-drawers'
* lisp/org.el (org-hide-drawer-all): New function.
(org-cycle-hide-drawers): move...
* lisp/org-compat.el (org-cycle-hide-drawers): ... here.
* lisp/org-agenda.el (org-agenda-show-1): Remove use of
`org-cycle-hide-drawers'.
2020-05-09 15:30:02 +02:00
Nicolas Goaziou 1027e02569 Implement `org-cycle-hide-property-drawers'
* lisp/org.el (org-cycle-hide-property-drawers): New function.
(org-set-startup-visibility):
(org-clean-visibility-after-subtree-move):
(org-sort-entries):
(org-cycle-hook):
(org-show-entry):
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Use new function.
2020-05-09 15:20:39 +02:00
Nicolas Goaziou 8b05c06d42 Use `outline' invisibility spec for property drawers
* lisp/org.el (org--hide-wrapper-toggle): Use `outline' invisibility
spec when hiding a property drawer.
(org-cycle): Fix typo.
2020-05-09 13:30:27 +02:00
Nicolas Goaziou ed0e75d241 Fix typo
* lisp/org.el (org-at-property-drawer-p): Fix typo.
* testing/lisp/test-org.el (test-org/at-property-drawer-p): Update
name and function calls.  Add a test.
2020-05-09 12:58:09 +02:00
Nicolas Goaziou 8580ef6ec1 Rename `org-at-property-block-p'
* lisp/org.el (org-at-property-drawer-p): New name.
* lisp/org-compat.el (org-at-property-block-p): Obsolete alias.
2020-05-09 12:50:34 +02:00
Nicolas Goaziou 7e7f5c6f03 Rewrite `org-at-property-block-p'
* lisp/org.el (org-comment-regexp): New variable.
(org-at-property-block-p): Rewrite function to check syntax locally.
(org-at-comment-p): Use new variable.
2020-05-09 12:47:37 +02:00
Nicolas Goaziou e39365e32f table: Avoid unnecessary consing
* lisp/org-table.el (org-table-align): Avoid unnecessary consing.
2020-05-09 10:44:43 +02:00
Nicolas Goaziou ba7bf12b44 table: Small refactoring of `org-table-align'
* lisp/org-table.el (org-table-align): Remove dead code.  Slightly
simplify code.
2020-05-08 23:40:57 +02:00
Nicolas Goaziou 984c7af21f table: `org-table-to-lisp' preserves text properties.
* lisp/org-table.el (org-table-to-lisp): Preserve text properties.
Otherwise, it breaks `org-table-align', which needs to know about
invisible characters.
2020-05-08 16:14:50 +02:00
Nicolas Goaziou 13195a4a5f table: Speed-up for `org-table-align'
* lisp/org-table.el (org-table-align): Use `org-table-to-lisp'.

Suggested-by: Thierry Banel <tbanelwebmin@free.fr>
2020-05-08 15:42:43 +02:00
Kyle Meyer cd61eedddb Merge branch 'maint' 2020-05-07 22:47:35 -04:00
Kyle Meyer ff56f580da capture: Correct docstring typo
* lisp/org-capture.el (org-capture--position-cursor): Correct
docstring typo.
2020-05-07 22:47:20 -04:00
Nicolas Goaziou 0edd9aee38 Merge branch 'maint' 2020-05-07 22:37:02 +02:00
Nicolas Goaziou 09086b7e75 Fix capturing plain text with :unnarrowed property and no "%?" marker
* lisp/org-capture.el (org-capture-narrow): Remove undocumented point
move.
(org-capture--position-cursor): New function.
(org-capture-place-entry):
(org-capture-place-item):
(org-capture-place-table-line):
(org-capture-place-plain-text): Use new function.
* testing/lisp/test-org-capture.el (test-org-capture/plain): Add test.

Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-05/msg00095.html>
2020-05-07 22:35:13 +02:00
Kévin Le Gouguec e47b053d9a compat: Add `org-newline-and-indent'
* lisp/org-compat.el (org-newline-and-indent): New function.
* lisp/org.el (org--newline): Use new function.
2020-05-07 21:34:32 +02:00
Nicolas Goaziou e304d58978 Revert "Fix docstring"
This reverts commit 5d308e2728.
2020-05-07 21:29:46 +02:00
Nicolas Goaziou 5d308e2728 Fix docstring
* lisp/org.el (org--newline): Fix docstring.
2020-05-07 14:10:05 +02:00
Kévin Le Gouguec d3e6b58004 Make RET and C-j obey `electric-indent-mode'
* lisp/org-compat.el (org-return-indent): Deprecate this command.
* lisp/org-keys.el (org-mode-map): Rebind C-j to a command emulating
`electric-newline-and-maybe-indent'.
* lisp/org.el (org-cdlatex-environment-indent): Stop using the now
obsolete function.
(org--newline): New helper function.
(org-return): Use it to transparently handle `electric-indent-mode'.
(org-return-and-maybe-indent): New command to emulate
`electric-newline-and-maybe-indent' while taking care of Org special
cases (tables, links, timestamps).
* testing/lisp/test-org.el (test-org/with-electric-indent,
test-org/without-electric-indent): New tests.
* testing/org-test.el (org-test-with-minor-mode): New helper to set a
minor mode to a specific state, and reset it afterward.
2020-05-07 12:14:30 +02:00
Kyle Meyer b171ff02f6 Merge branch 'maint' 2020-05-05 22:38:00 -04:00
Kyle Meyer f4fed7ea0c org: Retain prefix arg when dispatching dynamic block commands
* lisp/org.el (org-dynamic-block-insert-dblock): Add an interactive-p
argument that is non-nil for interactive calls and signals to call the
dynamic block function interactively.

org-clock-report takes a prefix argument.  When it had a regular
binding, this was easy to access.  As of 34b71a0ca (Add a dispatcher
command for inserting dynamic blocks, 2018-12-23), its only "binding"
is through the dynamic block dispatcher.  Make it possible to supply a
prefix argument in that context too.
2020-05-05 22:31:43 -04:00
Kyle Meyer 8368c38e01 Autoload dynamic block definitions
* lisp/org-clock.el:
* lisp/org-colview.el: Autoload call to org-dynamic-block-define.

The dynamic block dispatcher added in 34b71a0ca (Add a dispatcher
command for inserting dynamic blocks, 2018-12-23) offers an entry for
"clocktable" and "columnview" only after the corresponding library is
loaded.  However, before that commit, the autoloaded org-clock-report
and org-columns-insert-dblock commands were accessible via plain key
bindings.  Restore the ability to access these commands before the
associated library is loaded.

Reported-by: Axel Kielhorn <org-mode@axelkielhorn.de>
<3CE37EF0-6C7A-4CC0-AFEE-2B82296D63E1@axelkielhorn.de>
2020-05-05 22:31:43 -04:00
Nicolas Goaziou ea6a9bd6fa Add menu entry for `org-insert-structure-template'
* lisp/org.el (org-org-menu): Add entry.

Reported-by: John Ciolfi <ciolfi@mathworks.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-11/msg00157.html>
2020-05-06 02:47:35 +02:00
Nicolas Goaziou 271f5a6829 Insert planning in visible part of narrowed buffer
* lisp/org.el (org-add-planning-info): Make sure planning info appears
in the visible part of a narrowed buffer.
* testing/lisp/test-org.el (test-org/deadline):
(test-org/schedule): Update tests.

Reported-by: Michaël Cadilhac <michael@cadilhac.name>
<http://lists.gnu.org/r/emacs-orgmode/2019-09/msg00091.html>
2020-05-06 02:43:42 +02:00
Nicolas Goaziou 046f1d22ff org-ellipsis cannot be local variable
* lisp/org.el (org-ellipsis): docstring specifies it cannot be a local
variable.  As a consequence, remove :safe keyword.

Reported-by: "Mark E. Shoulson" <mark@shoulson.com>
<http://lists.gnu.org/r/emacs-orgmode/2020-01/msg00145.html>
2020-05-06 02:15:22 +02:00
Nicolas Goaziou 7d35d46494 Fix :package-version values
* lisp/ol.el (org-link-email-description-format):
* lisp/org-src.el (org-src-tab-acts-natively):
* lisp/org-table.el (org-table-header-line-p):
* lisp/org.el (org-loop-over-headlines-in-active-region):
(org-fontify-done-headline): Use correct (PACKAGE . VERSION-STRING)
value.  Remove :version keyword since :package-version overrides it.
2020-05-06 02:12:23 +02:00
Kyle Meyer 89b0d485b1 Merge branch 'maint' 2020-05-05 00:16:53 -04:00
Eric Timmons 0f783cbca8 ox-odt: Do not ignore org-odt-styles-file
* lisp/ox-odt.el (odt): Delete a repeated entry for :odt-styles-file
and absorb its org-odt-styles-file, which had no effect due to the
repeated entries, into the first definition.

TINYCHANGE
2020-05-05 00:15:57 -04:00
Roland Coeurjoly 6fd05fcaca ob-haskell: Print all results with :results output
* lisp/ob-haskell.el (org-babel-execute:haskell): Print all results,
including the last one.
2020-05-04 16:57:49 +02:00
Nicolas Goaziou e5eda0beeb table: Tiny clean-up
* lisp/org-table.el (org-table-export): Remove unnecessary calls to
`buffer-substring-no-properties'.
2020-05-02 11:32:17 +02:00
akater d23bd91874 org-agenda.el: Complete multiple todo keywords
* lisp/org-agenda.el (org-todo-list): Use completing-read-multiple
  instead of completing-read when selecting todo keywords to filter by
  in Agenda.  Fix a typo in the prompt.

TINYCHANGE
2020-05-01 23:32:29 -04:00
Marco Wahl 90185c98f4 table: Remove the last row (LR) feature
The feature was undocumented and broken according to Carsten.

* lisp/org-table.el (org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-get-formula):
(org-table-fix-formulas):
(org-table-analyze): Remove the parts refering to LR.
2020-05-02 00:04:30 +02:00