Commit Graph

22190 Commits

Author SHA1 Message Date
Gustav Wikström 3cbe356b0a org-test, test-org-element, test-org, test-ox, test-property-inheritance
* org-test.el:

Fix org-test-with-temp-text-in-file.  Make it work with <point>, as
some tests already expect it to do!  Also make it fail more gracefully
by still removing temporary buffers and files.

Improve org-test-in-example-file.  Make it behave similar to
org-test-with-temp-text and org-test-with-temp-text-in-file, in that
it will return the last evaluated expression.

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

Fix a temp-text strings so that it doesn't have an initial newline.

* testing/lisp/test-org.el

Minor cleanup to align code-structure with other tests.  Nothing
changes in the test execpt style.

* testing/lisp/test-ox.el

Fix a couple of temp-text strings so that they don't have initial
newlines.

** test-org-export/expand-include

Test specification was wrong, due to org-test-with-temp-text-in-file
not previously working with <point>.  Since that is fixed in this
patch the test needed to be updated to match the expected outcome.

* testing/lisp/test-property-inheritance.el

Fix wrong file-header and file-ending.
2019-07-07 19:42:50 +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
Nicolas Goaziou 2263634823 org-manual: Fix typo
* doc/org-manual.org (From Carsten): Fix typo.
2019-06-22 09:33:33 +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 65a6f54605 Backport commit 852d28176 from Emacs
Update author/maintainer info
852d28176990d035366142bfde36a0440a317228
Paul Eggert
Sun May 26 01:00:16 2019 -0700
2019-06-09 21:35:45 -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
Gregor Zattler f4083eefd8 manual: Fix URL
* doc/org-manual.org (External Links): Fix URL
2019-06-07 23:34:46 +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 fb50912228 org-manual: Fix link to CDLaTeX mode
* doc/org-manual.org (Using CDLaTeX to enter math): Fix link to
  CDLaTeX mode.

Reported-by: Qqwy/Wiebe-Marten <qqwy@gmx.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-06/msg00028.html>
2019-06-05 23:15:49 +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
Nicolas Goaziou 967801e2b8 ox: Make `org-export-table-cell-width' more robust
* lisp/ox.el (org-export-table-cell-width): Make
  `org-export-table-cell-width' robust against malformed tables.

Reported-by: michael <m.schoenwaelder@posteo.de>
<http://lists.gnu.org/r/emacs-orgmode/2019-05/msg00215.html>
2019-05-30 14:59:10 +02:00
Nicolas Goaziou b373e688be Merge branch 'maint' 2019-05-30 14:19:49 +02:00
Nicolas Goaziou 24555a0c00 Revert "Fix strike-through fontification on heading"
This reverts commit 42abf5c695.
2019-05-30 14:19:09 +02:00
Andrii Kolomoiets c103bc5acf org-clock: Fix restore of `frame-title-format`
* lisp/org-clock.el (org-frame-title-format-backup): Use nil as initial value.
(org-clock-in): set `org-frame-title-format-backup' to `frame-title-format'.
(org-clock-restore-frame-title-format): New function.
(org-clock-out): Use it.
(org-clock-cancel): Use it.

The problem was that the `org-frame-title-format-backup' variable is
initialized on org-clock.el loading and future changes to `frame-title-format'
is ignored.

TINYCHANGE
2019-05-28 19:58:52 +02:00
Nicolas Goaziou 4a383ee0f1 Merge branch 'maint' 2019-05-28 11:20:21 +02:00
Cheong Yiu Fung e4f5a194c7 org.el: Fix docstring of org-latex-packages-alist
* lisp/org.el (org-latex-packages-alist): Fix docstring to match
`org-latex-default-packages-alist'

TINYCHANGE
2019-05-28 11:19:51 +02:00
Nicolas Goaziou ff2bf22655 ox-html: Small refactoring
* lisp/ox-html.el (org-html--build-pre/postamble): Prefer `and' over
  `when' for short Sexps where return value matters.
2019-05-21 10:24:11 +02:00
Nicolas Goaziou f45caca608 Merge branch 'maint' 2019-05-21 10:17:37 +02:00
Nicolas Goaziou 31873ed27d ox-html: Do not generate empty validation link
* lisp/ox-html.el (org-html--build-pre/postamble): Do not generate
  empty validation link.

Reported-by: Nick Dokos <ndokos@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-05/msg00153.html>
2019-05-21 10:16:51 +02:00
Kyle Meyer 84a4b73fd6 Merge branch 'maint' 2019-05-16 21:23:18 -04:00
Cheong Yiu Fung 2c9f259d65 org-manual: Small fixes
* doc/org-manual.org (Handling Links): Update variable
`org-id-link-to-org-use-id', which was changed in v7.9.2.

TINYCHANGE
2019-05-16 21:22:19 -04:00
Nicolas Goaziou 0b0aa43ef2 Merge branch 'maint' 2019-05-16 10:44:28 +02:00
Achim Gratz be1d65b72f Ruby tests
Ruby tests have been failing for quite some time, here's my fix.

From 2f1bbaab939f6b6ceceb72862470e0576a8e2cba Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Sun, 12 May 2019 13:14:04 +0200
Subject: [PATCH 1/1] test-ob-ruby.el: fix tests

* testing/lisp/test-ob-ruby.el: Output no longer contains a trailing
  newline, remove from the template to compare against.  Session must
  be named for the tests to actually work, also add some extra code to
  ascertain that the code after the output statement has actually run
  in the session.
2019-05-16 10:43:14 +02:00
Nicolas Goaziou 2579d88323 ox-latex: Allow labels in matrices
* lisp/ox-latex.el (org-latex--label): Add "eq:" prefix for matrices.
(org-latex-link): Properly refer to matrices.
(org-latex--wrap-latex-matrices): Inherit name from first table.
(org-latex-matrices): Insert label within "equation" environment.

Reported-by: edgar@openmail.cc
<http://lists.gnu.org/r/emacs-orgmode/2019-05/msg00095.html>
2019-05-13 00:51:39 +02:00
Nicolas Goaziou 50986c4863 ox: Resolve fuzzy links pointing to pseudo-elements
* lisp/ox.el (org-export-resolve-fuzzy-link): Look for name also in
  pseudo-elements.
2019-05-13 00:50:54 +02:00
Nicolas Goaziou 12f93c112b Use `org-flag-subtree' instead of `outline-hide-subtree'
* lisp/org-agenda.el (org-agenda-show-1):
* lisp/org-archive.el (org-archive-to-archive-sibling):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org-feed.el (org-feed-update):
* lisp/org.el (org-set-visibility-according-to-property):
(org-move-subtree-down):
(org-paste-subtree):
(org-yank-generic):
* testing/lisp/test-org-inlinetask.el (test-org-inlinetask/folding-directly-consecutive-tasks/1): Use `org-flag-subtree' instead of `outline-hide-subtree'.

`outline-hide-subtree' leaves overlays on top of white spaces,
particularly at the end of the buffer. `org-flag-subtree' does not.
2019-05-11 09:48:53 +02:00
Nicolas Goaziou cd1af27a2a Merge branch 'maint' 2019-05-10 19:38:27 +02:00
Josiah Schwab 4df7051255 manual: Update ADS link abbreviation example
* doc/org-manual.org (Link Abbreviations): Change URL.

Reported-by: Alain Kalker <a.c.kalker@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-05/msg00083.html>

TINYCHANGE
2019-05-10 19:36:58 +02:00