Commit Graph

1759 Commits

Author SHA1 Message Date
stardiviner 4456dc8809 ob-clojure: Support `org-babel-initiate-session'
* ob-clojure.el (org-babel-clojure-initiate-session): Initialize session
for source block.
(org-babel-prep-session:clojure): Prepare Clojure session.
(org-babel-clojure-var-to-clojure): Convert header argument :var into
clojure variables definitions.
(org-babel-variable-assignments:clojure): Support assigning variables
when initializing a session.
2018-10-25 10:28:41 +02:00
Nicolas Goaziou 8da5168dd1 Merge branch 'master' into next 2018-10-23 23:28:38 +02:00
Nicolas Goaziou 17e28d6467 org-capture: Various fixes to item capture
* lisp/org-capture.el (org-capture-place-item): Rewrite function.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add test.
(test-org-capture/item): New test.
2018-10-23 23:27:28 +02:00
Nicolas Goaziou ea47ed0d76 Merge branch 'master' into next 2018-10-23 01:53:54 +02:00
Nicolas Goaziou 7a4a10dea0 org-capture: Fix plain capture at the end of the buffer.
* lisp/org-capture.el (org-capture-place-plain-text): Fix plain
  capture at the end of the buffer.
* testing/lisp/test-org-capture.el (test-org-capture/plain): New test.
2018-10-23 01:26:17 +02:00
Nicolas Goaziou ad0fce50eb org-capture: Small fix to table line capture
* lisp/org-capture.el (org-capture-place-table-line): Handle abort
  table line insertion more gracefully.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add tests
2018-10-23 00:43:59 +02:00
Nicolas Goaziou e7b5cc4d29 Merge branch 'master' into next 2018-10-22 23:42:07 +02:00
Nicolas Goaziou aaa3372b8b org-capture: Fix capture aborting
* lisp/org-capture.el (org-capture-place-entry): Fix delimiters for
  region to delete when aborting capture.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add test.
2018-10-22 23:40:49 +02:00
Nicolas Goaziou 796a7c4c0e Merge branch 'master' into next 2018-10-22 22:26:41 +02:00
Nicolas Goaziou 0fa8bb4c51 org-capture: Inserting an entry doesn't break structure
* lisp/org-capture.el (org-capture-place-entry): Carefully narrow
  buffer to not alter following headline.  Also include leading empty
  lines in region to remove when cancelling capture.
* testing/lisp/test-org-capture.el (test-org-caputre/entry): New test.
(test-org-capture/abort): Rename test.

Reported-by: Martin Yrjölä <martin.yrjola@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00256.html>
2018-10-22 22:22:21 +02:00
Nicolas Goaziou 1f913ecc36 Merge branch 'master' into next 2018-10-18 18:15:59 +02:00
Nicolas Goaziou 102ab1a245 org-pcomplete: Add tests
* testing/lisp/test-org-pcomplete.el (test-org-pcomplete/clocktable):
(test-org-pcomplete/drawer):
(test-org-pcomplete/entity):
(test-org-pcomplete/link):
(test-org-pcomplete/search-heading):
(test-org-pcomplete/todo): New tests.
2018-10-18 18:01:33 +02:00
Nicolas Goaziou 4d8c78a0ef Merge branch 'master' into next 2018-10-14 09:09:23 +02:00
Nicolas Goaziou 085f150372 ob-tangle: Add a test
* testing/lisp/test-ob-tangle.el (ob-tangle/block-order): Add test.
2018-10-14 09:08:44 +02:00
Gong Qijian 2b96fc9171 ob-core: Fix `org-babel--string-to-number'
* lisp/ob-core.el (org-babel--string-to-number): Fix the regular expression.
* testing/lisp/test-ob.el (test-ob/string-to-number): Test cases.

If people write the data in the form "0001"", it means that he wants to
treat it as a string.

TINYCHANGE

> #+name: TBL
> |   id | name   | age |
> |------|--------|-----|
> | 0001 | Apollo |  16 |
> | 0002 | Bmw    |  16 |
>
> #+BEGIN_SRC emacs-lisp :results value pp :var tbl=TBL
> (mapc 'print tbl)
> #+END_SRC
>
> #+RESULTS:
> : (("0001" "Apollo" 16)
> :  ("0002" "Bmw" 16))

TINYCHANGE
2018-10-13 23:22:05 +02:00
Nicolas Goaziou 848037d54c Merge branch 'master' into next 2018-10-13 16:59:49 +02:00
Dima Gerasimov 7a09c33867 org-agenda: New test for setting priority
* testing/examples/agenda-file.org: Add a subnote, make sure it has no
  impact on agenda.
* testing/lisp/test-org-agenda.el (test-org-agenda/set-priority): New
  test.

TINYCHANGE
2018-10-13 16:58:33 +02:00
Nicolas Goaziou 100edaccd1 Implement `month' and `year' steps in clock tables
* doc/org-manual.org (The clock table): Update manual.
* lisp/org-clock.el (org-clocktable-steps): Rewrite function.  Add
  `month' and `year' steps.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/step): Add
  tests.
2018-10-13 16:22:43 +02:00
Nicolas Goaziou 5341312b79 Merge branch 'master' into next 2018-10-11 00:02:46 +02:00
Nicolas Goaziou 2fda33bfef ob-tangle: Fix tangling order
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Preserver order
  of code blocks from the source document.
* testing/lisp/test-ob-tangle.el (ob-tangle/block-order): New test.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00062.html>
2018-10-11 00:01:50 +02:00
Nicolas Goaziou 26ed66b233 ob: :file and :file-ext no longer imply :results file
* lisp/ob-core.el (org-babel-execute-src-block): ":results file" must
  be specified in order to return a file.
(org-babel-merge-params): :file and :file-ext no longer imply :results
file.
* testing/lisp/test-ob.el (test-ob/indented-cached-org-bracket-link):
(test-ob/result-file-link-type-header-argument):
(test-ob/result-graphics-link-type-header-argument): Update tests.

Deducing the results from some other arguments is not obvious.
Moreover, it prevents users from setting, e.g., :file-ext, in a node
property, as every block would then create a file.

Reported-by: Alex Fenton <alex@pressure.to>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00469.html>
2018-10-06 08:56:05 +02:00
Marco Wahl ed9bdfd220 Merge branch 'master' into next 2018-10-05 00:54:19 +02:00
Marco Wahl 0ae2e656d7 test-org: More tests for cut and paste subtree 2018-10-04 23:49:00 +02:00
Benjamin Motz 3cb4ffe957 org-colview: Add property :exclude-tags to column view table
* lisp/org-colview.el (org-columns--capture-view): Add parameter.
(org-dblock-write:columnview): Add new property.
* doc/org-manual.org (Capturing column view): Document feature.
* testing/lisp/test-org-colview.el (test-org-colview/dblock): Add
  test.

This addition allows to specify a list of tags to exclude from column
view tables.

TINYCHANGE
2018-10-03 18:44:34 +02:00
Nicolas Goaziou 6995f206ad org-colview: Fix failing test
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Fix failing test.

Since 3367ac945796d7b65feb3c2d0ceb9734a6bbd19c, plain numbers in
properties are minutes instead of hours.
2018-10-03 18:44:34 +02:00
Chris Kauffman d0a5308435 org-table: Adding single cell movement functions
* lisp/org-table.el (org-table--swap-cells):
(org-table--move-cell):
(org-table-move-cell-up):
(org-table-move-cell-down):
(org-table-move-cell-left):
(org-table-move-cell-right): New functions.

* testing/lisp/test-org-table.el (test-org-table/move-cell-down):
(test-org-table/move-cell-up):
(test-org-table/move-cell-right):
(test-org-table/move-cell-left): New tests.

* doc/org-manual.org (Column and row editing): Document functions and
  keybindings for single cell movement.
2018-10-03 18:44:34 +02:00
stardiviner 1b81d6e07b ob-eshell.el: Add Eshell support for Babel
* lisp/ob-eshell.el (org-babel-execute:eshell): Execute Eshell code in Babel.
(org-babel-prep-session:eshell):
(ob-eshell-session-live-p):
(org-babel-eshell-initiate-session):
(org-babel-variable-assignments:eshell):
(org-babel-load-session:eshell):

* testing/test-ob-eshell.el: Write test for ob-eshell.

* doc/org-manual.org (Languages): Add Babel language eshell identity.
2018-10-03 18:44:34 +02:00
Marco Wahl f82a3051a9 test-org-bbdb.el: new tests
* testing/lisp/test-org-bbdb.el (test-org-bbdb-anniv-extract-date):
  Test function `org-bbdb-anniv-extract-date'.
2018-09-23 17:03:00 +02:00
Nicolas Goaziou 17edaf8c14 "src block" -> "source block" in documentation and comments
* etc/ORG-NEWS (Maxima: new headers ~:prologue~ and ~:epilogue~):
(Texinfo exports inline source blocks as ~@code{}~):
(Default lexical evaluation of emacs-lisp source blocks):
* lisp/ob-clojure.el (org-babel-clojure-default-ns):
* lisp/ob-core.el (org-babel-named-src-block-regexp-for-name):
(org-babel-current-src-block-location):
(org-babel-mark-block):
(org-babel-insert-result):
* lisp/ob-emacs-lisp.el (org-babel-default-header-args:emacs-lisp):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-lob.el (org-babel-lob-ingest):
* lisp/ob-ref.el:
* lisp/org-element.el (org-element-object-restrictions):
(org-element-src-block-parser):
(org-element-inline-src-block-parser):
* lisp/org-lint.el:
(org-lint--checkers):
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src):
* lisp/org-src.el (org-edit-inline-src-code):
* lisp/org.el (org-ctrl-c-ctrl-c):
(org-in-src-block-p):
(org-fill-element):
* lisp/ox-html.el (org-html--textarea-block):
(org-html-format-code):
* lisp/ox-latex.el (org-latex-minted-options):
(org-latex-custom-lang-environments):
* lisp/ox-md.el:
* lisp/ox-odt.el (org-odt-format-code):
* lisp/ox.el (org-export-collect-listings):
* testing/lisp/test-ob-exp.el (ob-exp/src-block-with-affiliated-keyword):
* testing/lisp/test-ob.el (test-ob/preserve-results-indentation):
  Correct "src block" occurrences when they do not specifically refer
  to the element type `src-block'.
2018-09-20 11:23:49 +02:00
Robert Klein 1e6ab19b2a Fix tests for sqlite
- sqlite executable used by ob-sqlite is 'sqlite3'
- require ob-sqlite for test
2018-09-13 23:04:57 +02:00
Nicolas Goaziou 9029161bcd org-footnote: Fix failing test
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Fix
  failing test.
2018-09-05 19:04:34 +02:00
Nicolas Goaziou cbb7be9c25 Revert "org-footnote: Fix location after moving to definition"
This reverts commit 8500501984.
2018-08-30 23:59:01 +02:00
Nicolas Goaziou 1334572582 org-macs: Optimize `org-string-width'
* lisp/org-macs.el (org--string-from-props): New function.
(org-string-display): Remove function.
(org-string-width): Use new function.
2018-08-30 21:09:57 +02:00
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