Commit Graph

1726 Commits

Author SHA1 Message Date
Matt Lundin 5e27b2fd32 Ensure that org-get-tags returns all local tags
* lisp/org.el: (org-get-tags) Create a clearer separation between
  local and inherited tags in the function, so that
  org-remove-uninherited tags is only run on inherited tags. This is
  important to avoid destroying existing tags when adding new tags.
* testing/lisp/test-org.el: (test-org/get-tags) Add regression test
2018-08-19 10:28:27 +02:00
Nicolas Goaziou d975b44fd4 Fix `org-kill-line' on tag lines
* lisp/org.el (org-kill-line): Preserve tags when `org-special-ctrl-k'
  is non-nil.
* testing/lisp/test-org.el (test-org/kill-line): New test.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00122.html>
2018-07-17 22:24:01 +02:00
Nicolas Goaziou 65ebb128bc org-macro: Fix "results" macro
* lisp/org-macro.el (org-macro-initialize-templates): Do not
  initialize the special "results" macro.
(org-macro-replace-all): Do not raise an error if "results" macro has
no associated template yet.
* lisp/ox.el (org-export-as): Update code comments.
* testing/lisp/test-ox.el (test-org-export/expand-macro): Add test.
2018-07-07 12:53:13 +02:00
Nicolas Goaziou 7d9e4da447 Prevent spurious newline character in fixed-width area value
* lisp/org-element.el (org-element-fixed-width-parser): Prevent
  spurious newline character at the end of the value.
* lisp/ox-latex.el (org-latex-fixed-width):
* lisp/ox-man.el (org-man-fixed-width):
* lisp/ox-texinfo.el (org-texinfo-fixed-width):
* contrib/lisp/ox-groff.el (org-groff-fixed-width): Adapt to change.
* testing/lisp/test-org-element.el (test-org-element/fixed-width-parser):
  Update tests.

Reported-by: 孙振祥 <sunznx@icloud.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2018-07/msg00003.html>
2018-07-02 00:24:38 +02:00
Nicolas Goaziou 937e7ce76b org-macs: Fix last commit
* lisp/org-macs.el (org-parse-time-string): Fix typo in last commit.
* testing/lisp/test-org-element.el (test-org-element/timestamp):
  Rename to `test-org-element/timestamp-parser'.
2018-07-02 00:18:44 +02:00
Robert Irelan e1f197aec7 org-clock: Test clocktable behavior under `org-extend-today-until'
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/extend-today-until):
  New test.
2018-06-27 08:31:47 +02:00
Nicolas Goaziou 627cb7f578 org-footnote: Fix `org-footnote-goto-previous-reference'
* lisp/org-footnote.el (org-footnote-goto-previous-reference): Only
  add to mark ring on a successful match.  Improve error message when
  reference is outside visible part of buffer.
(org-footnote-get-next-reference): Avoid using
`org-footnote-at-reference-p', which is inaccurate, due to
`org-footnote-in-valid-context-p'.
* testing/lisp/test-org-footnote.el (test-org-footnote/goto-previous-reference):
  New test.
2018-06-24 11:25:15 +02:00
Marco Wahl a6b4cec691 org-agenda: Refactored. Add test.
* lisp/org-agenda.el (org-agenda-mode): Factored out a function for a
  loop occuring two times.
* testing/lisp/test-org-agenda.el: test the text scale after
  agenda-undo.
2018-06-24 09:52:29 +02:00
Nicolas Goaziou 62dd2cc829 Fix regression in tags alignment
* lisp/org.el (org--align-tags-here): Correctly preserve column.
* testing/lisp/test-org.el (test-org/tag-align): Add test.

The regression was introduced in
593058e4a6.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00245.html>
2018-06-22 18:49:11 +02:00
Henry Blevins f2500e06f3 ob-scheme: Add tests for scheme result types
* test-ob-scheme.el (test-ob-scheme/verbatim, test-ob-scheme/list):
  New tests.
2018-06-21 22:00:50 +02:00
Nicolas Goaziou 031c53103a org-capture: Fix formulas when capturing rows
* lisp/org-capture.el (org-capture-finalize): Possibly update formula
  when inserting the captured rows in the table.

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

Reported-by: "Holst Thomas (PS-EC/ESE4)" <Thomas.Holst@de.bosch.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00276.html>
2018-06-21 18:09:40 +02:00
Nicolas Goaziou 547b431e70 org-capture: Fix row insertion in a table with a formula
* lisp/org-capture.el (org-capture-place-table-line): Insert new row
  above the formula, not below.
* testing/lisp/test-org-capture.el (test-org-capture/table-line): Add
  test.
2018-06-21 12:17:07 +02:00
Nicolas Goaziou 593058e4a6 `org-set-tags' modifies buffer only when necessary
* lisp/org.el (org--align-tags-here):
(org-set-tags): Modify buffer only when necessary.

* testing/lisp/test-org.el (test-org/set-tags): Add tests.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00242.html>
2018-06-19 09:40:00 +02:00
Nicolas Goaziou 3745c0af9f Fix indentation when wrapping a block around a region
* lisp/org.el (org-insert-structure-template): Indent like the first
  line, not the line the point happens to be on.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00107.html>
2018-06-12 09:03:33 +02:00
Marco Wahl 13a09b3ba5 Merge branch 'maint' 2018-06-06 16:05:26 +02:00
Marco Wahl 2b76aebfc6 org-element: Fix interpretation as todo kwd when prefix of headline
* lisp/org-element.el (org-element-headline-parser): Check for space
  after todo-kwd.
* testing/lisp/test-org-element.el (test-org-element/headline-todo-keyword):
  Respective tests.
2018-06-06 15:58:20 +02:00
Nicolas Goaziou ed7d1dc6d7 Fix quirks in `org-insert-structure-template'
* lisp/org.el (org-insert-structure-template): Fix some issues.
  Refactor code.
* testing/lisp/test-org.el (test-org/insert-structure-template):
  Update tests.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00553.html>
2018-06-02 23:41:56 +02:00
Nicolas Goaziou 9d51a8b5a0 org-capture: Fix table line capture with custom location
* lisp/org-capture.el (org-capture-place-table-line): Fix error when
  a precise location is given, e.g. with `file+function' target.

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

Reported-by: Thomas Holst <thomas_holst@gmx.de>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00359.html>
2018-05-17 22:57:49 +02:00
Nicolas Goaziou c46fcd9874 org-lint: Add checker for spurious colons in tags
* lisp/org-lint.el (org-lint--checkers): Add checker.
(org-lint-spurious-colons): New function.
* testing/lisp/test-org-lint.el (test-org/spurious-colons): New test.
2018-05-14 17:41:04 +02:00
Aaron Ecay d94d52489d test files: use cl- prefixed functions, and require cl-lib 2018-05-10 04:22:30 +01:00
Aaron Ecay 7fb3328db8 testing/README: update to new header arg property format 2018-05-10 04:22:30 +01:00
Nicolas Goaziou 9ab45860a6 Merge branch 'maint' 2018-05-01 15:06:57 +02:00
Nicolas Goaziou 80eb69b648 org-list: Proper error message when trying to indent top level item
* lisp/org-list.el (org-list-struct-indent): Return proper error
  message upon trying to indent a top-level item.  Use `user-error'.
* testing/lisp/test-org-list.el (test-org-list/indent-item): Add test.
2018-05-01 15:06:08 +02:00
Nicolas Goaziou ab53ee2c3d org-capture: Fix capturing in a table
* lisp/org-capture.el (org-capture-place-table-line): Rewrite function.
* testing/lisp/test-org-capture.el (test-org-capture/table-line): New
  test.
2018-04-30 00:52:57 +02:00
Nicolas Goaziou 946b469cc2 Remove unnecessary `(require 'cl)'
* testing/examples/babel.org: Remove unnecessary `(require 'cl)'.
2018-04-29 12:04:26 +02:00
Nicolas Goaziou a2994cb005 Mark "org-version-check" obsolete
* lisp/org-compat.el (org-version-check): Mark as obsolete.
(org-no-popups):
* testing/examples/babel.org: Remove use of `org-version-check'.
2018-04-29 11:54:40 +02:00
Nicolas Goaziou ba5bedc17f org-clock: Re-activate tests
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/ranges):
(test-org-clock/clocktable/step): Un-comment tests.

They were commented out in "org-clock.el: New option :tags to insert
tags in clock reports".
2018-04-29 00:22:53 +02:00
Nicolas Goaziou 1615261cdc Preserve point when setting or aligning tags
* lisp/org.el (org--align-tags-here):
(org-set-tags-command):
(org-align-tags): Preserve point.
* testing/lisp/test-org.el (test-org/set-tags-command): Add test.
2018-04-28 23:45:04 +02:00
Nicolas Goaziou c7c8370dfb Fix clock-related failing tests
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/match):
(test-org-clock/clocktable/tags): Fix test.
2018-04-28 02:47:35 +02:00
Nicolas Goaziou 031f362352 Fix `org-toggle-tag'
* lisp/org.el (org-toggle-tag): Fix weird behavior with inherited tags.

* testing/lisp/test-org.el (test-org/toggle-tag): Add test.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00537.html>
2018-04-28 02:10:44 +02:00
Marco Wahl a0a40a4651 org: Remove special whitespace treatment when moving subtree
* lisp/org.el (org-move-subtree-down): Remove special whitespace treatment.
* testing/lisp/test-org.el (test-org/drag-element-backward):
  Accommodate test.
2018-04-27 01:08:29 +02:00
Bastien f80f7ed98b org-clock.el: New option :tags to insert tags in clock reports
* lisp/org-clock.el (org-clocktable-defaults)
(org-clocktable-write-default, org-clock-get-table-data):
Rename :tags to :match and use :tags to insert a column with
the headline's tags.

Thanks to Raymond Zeitler for suggesting this.
2018-04-26 20:55:27 +02:00
Nicolas Goaziou 3719cdd48e org-table: Fix shrunk hlines
* lisp/org-table.el (org-table--shrink-field): Handle properly shrunk
  hlines with a width cookie.
* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
  Add test.  Fix tests.

Reported-by: William Denton <wtd@pobox.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00306.html>
2018-04-20 11:57:37 +02:00
Nicolas Goaziou 4d152b994e Rewrite tags setting functions
* lisp/org.el (org-setting-tags): Remove variable.
(org-set-tags-command): Change signature.  For interactive use only.
(org-set-tags-to): Remove function.
(org-align-all-tags): Remove function.
(org-align-tags): New function.
(org-set-tags): Change signature.  For non-interactive use only.
(org-promote):
(org-demote):
(org-refile):
(org-todo):
(org-priority):
(org-toggle-tag):
(org-entry-put):
(org-fix-tags-on-the-fly):
(org-ctrl-c-ctrl-c):
(org-delete-indentation):
(org-return):
(org-kill-line): Apply signature change.  Use new functions.
* lisp/ox-beamer.el (org-beamer-property-changed):
(org-beamer-select-environment): Apply signature change.  Use new
functions.
* testing/lisp/test-org-archive.el (test-org-archive/to-archive-sibling):
  Update test.
* testing/lisp/test-org.el (test-org/set-tags): Add tests.
(test-org/set-tags-command): New test.
(test-org/set-tags-to): Remove test.
2018-04-20 10:51:21 +02:00
Nicolas Goaziou 2a293843ad org-lint: Remove useless checker
* lisp/org-lint.el (org-lint--checkers): Remove useless checker.
(org-lint-empty-headline-with-tags): Remove function.
* testing/lisp/test-org-lint.el (test-org-lint/empty-headline-with-tags):
  Remove test.
2018-04-19 11:52:07 +02:00
Nicolas Goaziou fbe56f89f7 Change `org-get-tags' specifications
* lisp/org.el (org-tag-line-re): New variable.
(org-hide-archived-subtrees):
(org-get-buffer-tags): Use new function.
(org--get-local-tags): New function.
(org-get-tags): Change meaning.  Now get all inherited tags.  Change
signature.
* lisp/org-archive.el (org-archive-subtree):
* lisp/org-mobile.el (org-mobile-apply):
(org-mobile-edit):
* lisp/org-mouse.el (org-mouse-tag-menu):
* lisp/org-pcomplete.el (pcomplete/org-mode/tag): Apply change

* testing/lisp/test-org.el (test-org/get-tags): New test.
(test-org/tags-at): Remove test.
2018-04-19 11:51:54 +02:00
stardiviner b088389c6b ob-core: Add document and test for "graphics" format
* doc/org-manual.org: Document value.

* lisp/ob-core.el (org-babel-common-header-args-w-values): Handle
  symbol "graphics".

* testing/lisp/test-ob.el (test-ob/result-graphics-link-type-header-argument):
  New test.
2018-04-12 15:16:04 +02:00
stardiviner 296b0de4e8 ob-core: Add "link" results format
* lisp/ob-core.el (org-babel-execute-src-block): Handle "link" :results
  format.

* doc/org-manual.org: Add document for new result format "link".

* testing/lisp/test-ob.el (test-ob/result-file-link-type-header-argument):
  New test.
2018-04-12 15:15:59 +02:00
Nicolas Goaziou fb58727f32 Merge branch 'maint' 2018-04-08 18:39:36 +02:00
Nicolas Goaziou f05c2eae33 Fix RET on multi-line links
* lisp/org.el (org-return): Follow multi-line links.
* testing/lisp/test-org.el (test-org/return): Add tests.

Reported-by: Brent Goodrick <bgoodr@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00105.html>
2018-04-08 18:35:40 +02:00
Rasmus d04c20deec org: Change structure insertion
* lisp/org.el (org-insert-structure-template): Change newline
  behavior.
* testing/lisp/test-org.el (test-org/insert-template): New tests.

`org-insert-structure-template' considers indentation and also insert
newlines between the beginning and the end of the block.
2018-04-08 12:47:12 +02:00
Rasmus e5f6cb6c8b org-tempo: Various improvements
* lisp/org-tempo.el (org-tempo-keywords-alist): Improve docstring.
(org-tempo--update-maybe):
(org-tempo--keys): New function.
(org-tempo-complete-tag):
(org-tempo-setup):
(org-tempo-add-templates): Use new functions.
(org-tempo-add-block): Smarter position of point.
* testing/lisp/test-org-tempo.el (test-org-tempo/cursor-placement):
 (test-org-tempo/space-first-line): New tests.
* testing/lisp/test-org-tempo.el (test-org-tempo/completion): Adapt
  test to changes.

Org Tempo more carefully checks for new definitions.  When inserting
blocks point will differ depending on whether it is source block.
2018-04-08 12:47:12 +02:00
Rasmus b56df737b7 org: org-structure-template-alist uses string keys
* lisp/org-tempo.el (org-tempo-keywords-alist):
  (org-tempo-setup):
  (org-tempo-add-templates):
* testing/lisp/test-org-tempo.el (test-org-tempo/add-new-templates):
* lisp/org.el (org-structure-template-alist): Use string keys.
  (org--insert-structure-template-mks):
  (org--insert-structure-template-unique-keys): New functions for block selection.
  (org-insert-structure-template): Use new functions.
* etc/ORG-NEWS:
* doc/org-manual.org: Reflect changes.
2018-04-08 12:47:12 +02:00
Nicolas Goaziou a1ca78d5b8 Merge branch 'maint' 2018-04-03 21:28:37 +02:00
Gong Qijian 1966d58b25 ob-python: Insert blank line when sending code to interpreter
* lisp/ob-python.el (org-bable-python-evaluate-session):

Syntax error occurs when evaluating the following code block:

\#+begin_src python :session
if True:
    1
2
\#+end_src

A blank line is required for top level module code to end an indented block, such as a for loop, try/except, or if statement.

https://www.python.org/dev/peps/pep-0008/#blank-line

TINYCHANGE
2018-04-03 21:24:18 +02:00
Nicolas Goaziou e462125cfc org-table: Improve shrinking on right-aligned and centered columns
* lisp/org-table.el (org-table--make-shrinking-overlay): New function.
(org-table--shrink-field): Use new function.
(org-table--shrink-columns): Update function.
* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
  Update test.
2018-04-02 20:30:40 +02:00
Nicolas Goaziou 9aaa035e88 Merge branch 'maint' 2018-03-25 22:56:01 +02:00
Nicolas Goaziou 8c9ebc81f0 Revert "ob-table: Fix org-sbe's handling of quotes in cell values"
This reverts commit 5b59e16c9e.
2018-03-25 22:55:24 +02:00
Nicolas Goaziou 9e70db6bab Revert "ob-table: Fix org-sbe's handling of list arguments"
This reverts commit c9d617b322.
2018-03-25 22:55:14 +02:00
Nicolas Goaziou d33e6eae51 org-macro: Refactoring
* lisp/org-macro.el (org-macro-initialize-templates): Refactor function.
* testing/lisp/test-org-macro.el (test-org/macro-replace-all): Remove
  duplicate tests.  Add new test.
2018-03-23 23:40:56 +01:00