Commit Graph

20337 Commits

Author SHA1 Message Date
Nicolas Goaziou f53d1e2005 Let `or-export-last-sibling-p' handle discontinuous headlines
* lisp/ox.el (org-export-last-sibling-p): Handle discontinuous
  headlines.
* testing/lisp/test-ox.el (test-org-export/last-sibling-p): Add test.

Fixes: 24836
2017-12-02 12:22:32 +01:00
Nicolas Goaziou 0cc231a7bb Call store link functions only once
* lisp/org.el (org-store-link): Call store link functions only once.

Fixes: 19914
2017-12-01 19:33:35 +01:00
Nicolas Goaziou 6fe212a3ec org.texi: Fix incorrect statement about dynamic blocks
* doc/org.texi (Capturing column view):
(The clock table): Correct statement.

Reported-by: Jorge Morais Neto <jorge13515@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2017-11/msg00429.html>
2017-11-29 23:01:43 +01:00
Matt Lundin dd3bf50adf Preserve point when storing link in Gnus nnir groups
* lisp/org-gnus.el: (org-gnus-store-link) This fixes a similar issue
  as commit 84b329516e, but for
  nnir search groups in gnus.
2017-11-29 21:05:19 +01:00
Matt Lundin 84b329516e Preserve position of point in gnus virtual group
* lisp/org-gnus.el: (org-gnus-store-link) Add a save-excursion to
  protect the position of point. Otherwise, when calling org-capture
  in an article with a virtual group, the point is moved and the
  region captured is incorrect.
2017-11-29 19:02:57 +01:00
Nicolas Goaziou 45c4502713 org-capture: Re-introduce history list per prompt
* lisp/org-capture.el (org-capture--prompt-history-table):
(org-capture--prompt-history): New variables.

(org-capture-fill-template): Handle history list per prompt.

Reported-by: Karl Eichwalder <ke@gnu.franken.de>
<http://lists.gnu.org/r/emacs-orgmode/2017-11/msg00251.html>
2017-11-29 15:09:44 +01:00
Nicolas Goaziou 12ea0f08f4 Fix some tests
* testing/lisp/test-org.el (test-org/comment-dwim): Fix tests
2017-11-29 14:37:12 +01:00
Nicolas Goaziou b4b2809eb1 ob-core: Fix `org-babel-src-block-names'
* lisp/ob-core.el (org-babel-src-block-names): Do not change
  visibility or windows when called.
2017-11-28 23:57:18 +01:00
Nicolas Goaziou ebe9eb2423 ob-core: Fix last commit
* lisp/ob-core.el (org-babel-result-end): Add missing `example-block'
  result type.
2017-11-28 23:35:01 +01:00
Nicolas Goaziou d7940ae2a7 ob-core: Fix removal of elements after RESULTS
* lisp/ob-core.el (org-babel-result-end): Ignore elements that do not
  correspond to a valid result type (e.g., a headline).

Fixes commit 1d8126385c.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2017-11/msg00384.html>
2017-11-27 23:23:04 +01:00
Nicolas Goaziou 5873d99121 Fix headline fontification
* lisp/org.el (org-do-emphasis-faces): Do not emphasize stars in
  headlines.

Reported-by: swflint@flintfam.org (Samuel W. Flint)
<http://lists.gnu.org/r/emacs-orgmode/2017-11/msg00363.html>
2017-11-27 22:54:41 +01:00
Paul Eggert adfbfd42b2 Backport commit a89f0b6f3 from Emacs
maint: shorten https://lists.gnu.org/archive/html/... links
a89f0b6f33f9eb8910a1fceda9028d76ef50b05d
Paul Eggert
Sat Nov 25 22:48:12 2017 -0800
2017-11-26 20:35:46 -05:00
Nicolas Goaziou ac4b756588 Silence byte-compiler 2017-11-26 11:01:55 +01:00
Nicolas Goaziou 18f6610b32 ox-html: Fix last commit
* lisp/ox-html.el (org-html-link): Fix last commit.
2017-11-26 10:57:02 +01:00
Matt Lundin 63f6e851bc Do not save target buffer after archiving subtree
* lisp/org-archive.el: (org-archive-subtree) Do not save buffer after
  each archive.  Saving the archive buffer after archiving each
  subtree results in substantial slowdown and many writes to disk when
  archiving an active region.  This brings the behavior of
  org-archive-subtree into line with org-refile, which does not save
  the target buffer after refiling.
2017-11-26 10:52:03 +01:00
Nicolas Goaziou 6aac798f25 Fix publishing links to absolute file names belonging to project
* lisp/ox-publish.el (org-publish-file-relative-name): New function.
* lisp/ox-html.el (org-html-link): Use new function.

* testing/lisp/test-ox-publish.el (test-org-publish/file-relative-name):
  New test.
2017-11-26 10:46:53 +01:00
Nicolas Goaziou 1d8126385c ob-core: Fix results removal without blank line between source and results
* lisp/ob-core.el (org-babel-remove-result): Delete blank lines before
  results.
(org-babel-result-end): Use `org-element-at-point'.
* testing/lisp/test-ob.el (test-ob-verify-result-and-removed-result):
  Remove duplicate.
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--no-blank-line):
  New test.
* testing/lisp/test-ob.el (test-ob/results-in-narrowed-buffer): Small
  refactoring.

Reported-by: Ken Mankoff <mankoff@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00338.html>
2017-11-25 21:07:52 +01:00
Nicolas Goaziou ed06b159c3 Small fix to emphasis fontification
* lisp/org.el (org-do-emphasis-faces): Do not span over paragraph
  separators.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00202.html>
2017-11-25 15:42:10 +01:00
Nicolas Goaziou 1b1966a144 Fix cross-references from %-encoded links in publishing
* lisp/ox-publish.el (org-publish-resolve-external-link): Decode
  search string.

Reported-by: Martin Hans <martinhansdk@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00328.html>
2017-11-25 15:30:56 +01:00
Nicolas Goaziou 3226129036 org.texi: Fix typo
* doc/org.texi (Export settings): Fix typo introduced in last commit.
2017-11-20 00:14:22 +01:00
Nicolas Goaziou 82812ff086 ox: Fix UNNUMBERED strict inheritance
* lisp/ox.el (org-export-numbered-headline-p): Use a less opinionated
  definition of inheritance.

* testing/lisp/test-ox.el (test-org-export/numbered-headline-p):
  Update test.

* doc/org.texi (Export settings): Insist on UNNUMBERED inheritance.

It is now possible to number a headline within an unnumbered tree.
2017-11-20 00:09:59 +01:00
Nicolas Goaziou 946f76d707 org-table: Better fix for `:org-untouchable'
* lisp/org-table.el (org-table-recalculate): Fix typo in existing
  `remove-text-properties' call instead of adding a new one.

Also, cleaning property before processing formulas is more robust,
e.g., if last process raised an error.
2017-11-15 22:47:06 +01:00
Nicolas Goaziou 696ec60341 org-macs: Fix typos in docstrings
* lisp/org-macs.el (org-split-string):
(org-string-width): Fix typo in docstring.
2017-11-15 18:58:44 +01:00
Nicolas Goaziou 40f73953f6 Fix `org-string-display'
* lisp/org-macs.el (org-string-display): Preserve original string's
  display property when computing displayed width.

* testing/lisp/test-org-macs.el (test-org/string-display): Add test.

Reported-by: Ruy Exel <ruyexel@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00160.html>
2017-11-15 18:13:34 +01:00
Nicolas Goaziou 6059c3a057 org-table: Clean left-over `:org-untouchable' property
* lisp/org-table.el (org-table-recalculate): Clean `:org-untouchable'
  property once we no longer need it.

* testing/lisp/test-org-table.el (test-org-table/formula-priority):
  New test.

Reported-by: Ruy Exel <ruyexel@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00159.html>
2017-11-15 17:40:22 +01:00
Charles A. Roelli 18af0f88d7 Backport commit 98288ecaf from Emacs
* lisp/org-clock.el (org-clock--oldest-date): Fix an issue when
compiling on macOS 10.6 with a western time zone (a continuation of
Bug#27736).

Further workaround for faulty localtime() under macOS 10.6
98288ecaffbc0947ec3193088172ea85ad5e42a5
Charles A. Roelli
Wed Nov 8 20:51:48 2017 +0100
2017-11-13 22:07:59 -05:00
Chunyang Xu 3f8d67c490 ox-html: Allow disabling htmlize
* lisp/ox-html.el (org-html-fontify-code): Do it.

Disable htmlize by setting org-html-htmlize-output-type to nil.

TINYCHANGE
2017-11-12 23:28:57 +01:00
Martin Šlouf fcf4bb61ec Add CS export translations
* lisp/ox.el (org-export-dictionary): Add translations for CS.

TINYCHANGE
2017-11-12 22:37:04 +01:00
Marco Wahl 12e41c445b org-attach: Fix handling of ATTACH tag at sychronize
* lisp/org-attach.el (org-attach-sync): Remove ATTACH tag at
  synchronize when no files left.
2017-11-10 19:35:35 +01:00
Nicolas Goaziou 0880fc580e ox-ascii: Small fix to items that do not start with a paragraph
* lisp/ox-ascii.el (org-ascii-item): Use better heuristics to
  determine if contents should follow bullet or start a new line.

Contents follow bullet when the first contributing line is
a paragraph.  As a consequence, the following snippet

    -
      #+html: ...
      This is a paragraph.

is exported as

    - This is a paragraph.

instead of

    -
      This is a paragraph.

previously.
2017-11-06 23:07:17 +01:00
Nicolas Goaziou 7000ed9ee0 ox-ascii: Fix descriptive lists
* lisp/ox-ascii.el (org-ascii-quote-margin): Update docstring.
(org-ascii--current-text-width): Properly handle width of text within
nested plain-list items.
(org-ascii-item): Always start a new line for description contents.
Indent them by `org-ascii-quote-margin' characters.
2017-11-06 14:27:45 +01:00
Nicolas Goaziou 271e58f2dd Fix characters conversion issue when loading `org-id-locations-file'
* lisp/org-id.el (org-id-locations-load): Use `insert-file-contents'
  instead of `insert-file-contents-literally'.

Reported-by: Anders Johansson <mejlaandersj@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-11/msg00037.html>
2017-11-04 22:40:02 +01:00
Nicolas Goaziou 6186ed3a22 org-element: Fix item parser
* lisp/org-element.el (org-element--list-struct): Correctly handle end
  of sub-lists and end of last item.

* testing/lisp/test-org-element.el (test-org-element/item-parser):
(test-org-element/plain-list-parser): Add tests.
2017-11-04 21:50:11 +01:00
Nicolas Goaziou db16370c0b ox-texinfo: Fix @ref without description
* lisp/ox-texinfo.el (org-texinfo--@ref): Prefer @ref{} with a single
  argument when no description is provided.
2017-11-04 21:50:00 +01:00
Nicolas Goaziou 08c9de2a74 Fix typo in docstring
* lisp/org.el (org-speed-commands-user): Fix typo in docstring.
2017-11-03 23:10:38 +01:00
Xavier Martinez-Hidalgo f38a7d433b org-capture: Fix aborting after inserting text at end of buffer
* lisp/org-capture.el (org-capture-mark-kill-region): Set end marker
  insertion type so that it advances when inserting text at the end of
  the capture buffer.

* testing/lisp/test-org-capture.el (test-org-capture/insert-at-end-abort):
  Add test case.

Inserting text at the end of the capture buffer does not advance the
end kill marker.  This causes the narrowing region and the kill
markers to get out of sync, which prevents 'org-capture-finalize' from
correctly cleaning the target buffer when aborting the capture.

Setting the kill end marker insertion type fixes this.

TINYCHANGE
2017-11-03 22:20:11 +01:00
Nicolas Goaziou b5f075aa05 ox-texinfo: Fix spurious blank lines in detailed menu.
* lisp/ox-texinfo.el (org-texinfo--build-menu): Prevent spurious blank
  lines in detailed menu.
2017-11-03 12:21:56 +01:00
Nicolas Goaziou 8860fe2938 Fix `org-display-inline-images'
* lisp/org.el (org-display-inline-images): Fix regexp.

Reported-by: Leslie Watter <watter@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00455.html>
2017-10-31 19:33:55 +01:00
Nicolas Goaziou 2567fee3c9 Fix Org corruption when `org-agenda-files' is invalid
* lisp/org.el (org-install-agenda-files-menu): Prevent errors in
  `org-agenda-files' from corrupting Org initialization.

Reported-by: Allen Li <vianchielfaura@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00424.html>
2017-10-30 00:50:11 +01:00
Nicolas Goaziou 5c91976b49 ox-texinfo: Remove TABs from output
* lisp/ox-texinfo.el (org-texinfo--untabify): New function.
(texinfo): Use new function as a final output filter.

See (info "(texinfo) Conventions").
2017-10-24 13:55:38 +02:00
Nicolas Goaziou 3aa4d44ba8 Fix comma escaping with multiple leading commas
* lisp/org-src.el (org-escape-code-in-region):
(org-escape-code-in-string):
(org-unescape-code-in-region):
(org-unescape-code-in-string): Fix comma escaping with multiple
leading commas.

* testing/lisp/test-org-src.el (test-org-src/escape-code-in-string):
(test-org-src/unescape-code-in-string): New tests.

Reported-by: Michal Politowski <mpol@meep.pl>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00359.html>
2017-10-24 09:51:43 +02:00
Nicolas Goaziou a2a034f5b9 Prevent leaking fontification across table fields' borders
* lisp/org.el (org-do-emphasis-faces): Prevent leaking fontification
  across table fields' borders.

Reported-by: Ryan <rct@thompsonclan.org>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00321.html>
2017-10-22 14:39:36 +02:00
thibault 1613153aac Fix tangling of org block with nested source block
* lisp/ob-tangle.el (org-babel-tangle-single-block): Prevent double unescaping
of source block by removing unnecessary call to `org-unescape-code-in-string'.

* testing/lisp/test-ob-tangle.el (ob-tangle/nested-block) New function.
2017-10-22 12:42:05 +02:00
Marco Wahl 3df62457be ox-man: Fix org-man--protect-text 2017-10-20 12:21:08 +02:00
Nicolas Goaziou 37142cea78 ox-man: Fix verbatim markup
* lisp/ox-man.el (org-man--protect-text): New function.
(org-man-code): Use new function.
(org-man-verbatim): Use inline markup.
2017-10-19 21:51:31 +02:00
Nicolas Goaziou ee24c0769b ox-man: Fix code and verbatim export
* lisp/ox-man.el (org-man-code):
(org-man-verbatim): Fix functions.

Reported-by: Anthony Agelastos <iqgrande@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00313.html>
2017-10-18 22:54:40 +02:00
Allen Li 8c5c030c64 Fix `org-insert-todo-heading'
* lisp/org.el (org-insert-todo-heading): Insert TODO keyword relative
  to the original headline, not to the headline above.

* testing/lisp/test-org.el (test-org/insert-todo-heading-respect-content):
  Add test.
2017-10-18 22:48:16 +02:00
Allen Li 90d283f189 Update documentation on org-protocol template placeholders
* doc/org.texi (@code{capture} protocol): Fix placeholder names
(Template expansion): Add org-protocol placeholders

* lisp/org.el (org-store-link-plist): Fix docstring grammar
(org-store-link-props): Fix docstring grammar
2017-10-17 23:28:53 +02:00
Nicolas Goaziou 1d5142601a Silence byte-compiler 2017-10-14 12:32:08 +02:00
Nicolas Goaziou 827af59873 Fix links without contents in table of contents' entries
* lisp/ox.el (org-export-toc-entry-backend): New function.

* lisp/ox-html.el (org-html--format-toc-headline):
* lisp/ox-md.el (org-md--build-toc):
* lisp/ox-odt.el (org-odt-toc): Use new function.

* lisp/ox-texinfo.el (org-texinfo--sanitize-title):
(org-texinfo--wrap-float): Handle links without contents.

* testing/lisp/test-ox.el (test-org-export/toc-entry-backend): New
  test.

Reported-by: ConcreteVitamin <concretevitamin@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00235.html>
2017-10-14 12:29:52 +02:00