Commit Graph

1472 Commits

Author SHA1 Message Date
Nicolas Goaziou df0c345eac Merge branch 'maint' 2017-06-26 22:08:46 +02:00
Nicolas Goaziou bc1d6aadfd org-element: Fix $...$ parser error
* lisp/org-element.el (org-element-latex-fragment-parser): Also check
  border character right after opening "$" sign.
* testing/lisp/test-org-element.el (test-org-element/latex-fragment-parser):
Add tests.

Reported-by: thomas <thomas@friendlyvillagers.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/114285>
2017-06-26 22:07:05 +02:00
Nicolas Goaziou a0d1ad325d Merge branch 'maint' 2017-06-22 18:32:38 +02:00
Nicolas Goaziou 5d99560ddf Fix open-at-point in example blocks and diary-sexps
* lisp/org.el (org-open-at-point): Also open links in example blocks
  and diary-sexps.

* testing/lisp/test-org.el (test-org/open-at-point/keyword):
(test-org/open-at-point/property):
(test-org/open-at-point/comment): Add tests.

Reported-by: Dieter Faulbaum <Dieter.Faulbaum@helmholtz-berlin.de>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00277.html>
2017-06-22 18:30:58 +02:00
Nicolas Goaziou e90b643b05 Merge branch 'maint' 2017-06-21 22:35:28 +02:00
Nicolas Goaziou 112c5ba479 org-clock: Remove daylight saving time offset in duration
* lisp/org-clock.el (org-clock-out):
(org-clock-sum):
(org-clocktable-steps):
(org-clock-update-time-maybe): Use UTC to compute time differences.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/scope):
  Update test.
2017-06-21 22:32:57 +02:00
Nicolas Goaziou dbed60d6bd Merge branch 'maint' 2017-06-20 21:21:35 +02:00
Nicolas Goaziou 7fe9ae6bd2 org-element: Fix babel call parser
* lisp/org-element.el (org-element-babel-call-parser): Handle complex
  arguments.
* testing/lisp/test-org-element.el (test-org-element/babel-call-parser):
Add test.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00366.html>
2017-06-20 21:20:30 +02:00
Kaushal Modi d48cfdf68b Add hold 'action' to the "n" macro and ws-trim all "n" macro args
* lisp/org-macro.el (org-macro--counter-increment): Rename the
optional arg RESET to ACTION, as now that action can mean setting,
resetting or even holding the specified counter.  ACTION set to
"-" will hold the previous value of the counter.  White-space is
now trimmed from the NAME arg too.

* doc/org.texi (Macro replacement): Document the new hold action.

* testing/lisp/test-org-macro.el (test-org-macro/n): Add new tests for
the hold action.
2017-06-17 23:46:24 -04:00
Nicolas Goaziou 1c7cf61bd7 Merge branch 'maint' 2017-06-14 11:03:40 +02:00
Nicolas Goaziou b47920ed20 org-colview: Fix failing test
* lisp/org.el (org-parse-time-string): Allow to specify zone as an
  optional argument.
* lisp/org-colview.el (org-columns--age-to-seconds): Apply change
  above.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Update tests.
2017-06-14 11:00:01 +02:00
Nicolas Goaziou d8eaa8396d Fix failing test
* testing/lisp/test-org.el (test-org/file-contents): New test.  Merge
  from `test-org/org-file-contents-file' and
  `test-org/org-file-contents-url'.
2017-06-14 10:10:21 +02:00
Carsten Dominik feed16e1ed Merge branch 'master' of orgmode.org:org-mode 2017-06-14 05:46:17 +02:00
Carsten Dominik daff9c93f2 Implement new `U' mode switch for table formulas to omit seconds in durations
* lisp/org-table.el (org-table-duration-custom-format): Add new
	HH:MM format.
	(org-table-duration-hour-zero-padding): New option.
	(org-table-eval-formula): Select second-less format if
	requested.
	(org-table-time-seconds-to-string): Implement formats without
	seconds and without zero-padding for hours.

	* testing/lisp/test-org-table.el (test-org-table/duration):
	New test for second-less durations.

	* doc/org.texi (Formula syntax for Calc)
	(Durations and time values): Document the U mode switch.
2017-06-14 05:43:12 +02:00
Kaushal Modi 1e92f5ed39 Allow org-file-contents to fetch file contents from a URL
* lisp/org.el (org--file-cache): New variable.
(org-reset-file-cache):
(org-file-url-p): New function.
(org-mode-restart): Use new function.

* lisp/org.el (org-file-contents): Allow the FILE argument to be a
URL.  If the URL contents are already cached, return the cache
contents, else download the file and return contents of that.  The
file is automatically cached each time it is downloaded.  Add a new
optional argument NOCACHE.  If this is non-nil, the URL is always
downloaded afresh.  Use `org--file-cache' and `org-file-url-p'.

* lisp/org.el (org-edit-special): Do not allow editing the "file" if a
URL is specified for the "#+SETUPFILE".

* lisp/ox.el (org-export--list-bound-variables)
(org-export--prepare-file-contents):
* lisp/org-macro.el (org-macro--collect-macros) : Adapt to the
possibility that the input to `org-file-contents' can be a URL too.

* doc/org.texi (Export settings, In-buffer settings)
(The very busy C-c C-c key): Mention that #+SETUPFILE keyword can now
take a URL as a value, and that C-c C-c on the #+SETUPFILE line will
clear the org file cache.

* testing/lisp/test-org.el (test-org/org-file-contents-url)
(test-org/org-file-contents-file): Add tests for org-file-contents.

* testing/lisp/test-ox.el (test-org-export/get-inbuffer-options): Add
test for reading setupfile specified via a URL.
2017-06-13 11:41:58 -04:00
Nicolas Goaziou 8ebfbc1d2a Merge branch 'maint' 2017-06-10 00:14:30 +02:00
Nicolas Goaziou b8df40eccc ob-shell: Fix handling list variables
* lisp/ob-shell.el (org-babel--variable-assignments:bash): Do not
  error when value is a list.

* testing/lisp/test-ob-shell.el (ob-shell/simple-list): New test.

Reported-by: Keith Amidon <camalot@picnicpark.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/113920>
2017-06-10 00:06:24 +02:00
Kaushal Modi a933b34992 Merge branch 'maint' 2017-06-09 16:18:24 -04:00
Kaushal Modi 7cd7b90dcb Update remote file syntax for Tramp
* testing/lisp/test-ox.el (test-org-export/file-uri):
* doc/org.texi (External links): The method part of remote file names
is mandatory now in the emacs master (26+).  A valid remote file name
starts with "/method:host:" or "/method:user@host:".  ssh is used as
an example method here.

This change in the examples is backward compatible with emacs 25, 24, ..

Suggested by: Michael Albinus <michael.albinus@gmx.de>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00151.html>

Relevant commit in emacs master causing this change:
<http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ed33337c3e0d0b1a8b140e23168421ea43d79324>
2017-06-09 16:15:15 -04:00
Nicolas Goaziou 54344574c6 Merge branch 'maint' 2017-06-09 09:45:08 +02:00
Nicolas Goaziou 9a8506b7af org-footnote: Fix footnote deletion
* lisp/org-footnote.el (org-footnote-delete-definitions): Preserve
  blank lines after the definition.
* testing/lisp/test-org-footnote.el (test-org-footnote/delete): Add
  test.
2017-06-09 09:43:49 +02:00
Nicolas Goaziou 8e8094b919 Merge branch 'maint' 2017-06-08 15:04:55 +02:00
Nicolas Goaziou 3cf6345b40 org-macro: Fix macro expansion in commented trees
* lisp/org-macro.el (org-macro-replace-all): Prevent macro expansion
  in commented trees.
* testing/lisp/test-org-macro.el (test-org/macro-replace-all): Add
  tests.
* testing/lisp/test-ox.el (test-org-export/expand-macro): Remove
  tests.
2017-06-08 14:59:34 +02:00
Nicolas Goaziou 7b3ec6c105 Merge branch 'maint' 2017-06-08 00:59:06 +02:00
Nicolas Goaziou 9f5c252f93 org-src: Fix footnote reference remote editing
* lisp/org-src.el (org-edit-footnote-reference): Do not collapse
  footnote definitions after editing remotely one of them.

* testing/lisp/test-org-src.el (test-org-src/footnote-references): New
  test.
2017-06-08 00:57:38 +02:00
Kaushal Modi 4c24ecc073 Merge branch 'maint' 2017-06-07 18:40:56 -04:00
Nicolas Goaziou 84cfa58d4a org-element: Fix footnote definition parser
* lisp/org-element.el (org-element-footnote-definition-parser):
* testing/lisp/test-org-element.el (test-org-element/footnote-definition-parser):
  Add tests.
2017-06-07 23:45:17 +02:00
Nicolas Goaziou 57bf6bbbde Merge branch 'maint' 2017-06-05 18:47:25 +02:00
Nicolas Goaziou 82db669de6 org-macro: Expand macros only within narrowed part of buffer
* lisp/org-macro.el (org-macro-replace-all): Expand macros only within
  narrowed part of buffer.
* testing/lisp/test-org-macro.el (test-org/macro-replace-all): Update
  test.

Expanding macros outside in the whole buffer could make sense, e.g.,
if a macro expands to some Babel code, which, in turn, is evaluated
prior to export.  However, by principle of least surprise, it is
better to limit expansion to current accessible part of the buffer.
2017-06-05 18:08:42 +02:00
Nicolas Goaziou 496b2a9855 Merge branch 'maint' 2017-05-30 13:39:46 +02:00
Nicolas Goaziou 444d2673bb org-colview: Fix `org-columns' with a prefix argument
* lisp/org-colview.el (org-columns): Fix `org-columns' with a prefix
  argument.
* testing/lisp/test-org-colview.el (test-org-colview/columns-scope):
  Update test.

Reported-by: Hendrik Tews <hendrik@askra.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113721>
2017-05-30 13:38:54 +02:00
Nicolas Goaziou d7b203422f org-clock: Fix failing tests
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/maxlevel):
  Fix tests.
(test-org-clock/clocktable/tcolumns): Add test.
2017-05-27 18:15:05 +02:00
Nicolas Goaziou 75e9fdac6c org-clock: Fix number of time columns in clock table
* lisp/org-clock.el (org-clocktable-write-default): Limit number of
  time columns to the deepest headline level.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/maxlevel):
  Update tests.
2017-05-27 18:12:38 +02:00
Nicolas Goaziou 957850043a Prevent filling before a "n" macro where it could create list items
* lisp/org.el (org-fill-n-macro-as-item-nobreak-p): New function.
(org-setup-filling): Use new function.

* testing/lisp/test-org.el (test-org/fill-element): Add tests.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113587>
2017-05-25 12:33:16 +02:00
Nicolas Goaziou ad89390219 org-macro: Implement the "n" macro
* lisp/org-macro.el (org-macro--counter-table): New variable.
(org-macro--counter-initialize):
(org-macro--counter-increment): New functions.
(org-macro-initialize-templates): Use new functions.

* doc/org.texi (Macro replacement): Document new macro.

* testing/lisp/test-org-macro.el (test-org-macro/n):
(test-org-macro/property): New tests.
2017-05-25 12:25:13 +02:00
Nicolas Goaziou a023b31e48 Merge branch 'maint' 2017-05-23 18:15:42 +02:00
Nicolas Goaziou d6f096546e org-capture: Fix number of blank lines with :unnarrowed option
* lisp/org-capture.el (org-capture-finalize): Remove blank lines
  number fix, which only applies to narrowed capture buffers.
(org-capture-insert-template-here):
(org-capture-place-plain-text):
(org-capture-place-item):
(org-capture-place-entry): Do not hard-code number of blank lines
after entry.

Reported-by: Igor Perepelytsya <igorquail@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113093>

Reported-by: Jay Dresser <jay@jaydresser.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/113449>
2017-05-23 18:10:06 +02:00
Nicolas Goaziou 61eb86e06c Merge branch 'maint' 2017-05-22 15:28:48 +02:00
Nicolas Goaziou 7f0391cfe0 org-colview: Remove error upon summarizing non-numbers with a format string
* lisp/org-colview.el (org-columns--displayed-value): Remove check.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Remove a test.

Reported-by: Hendrik Tews <hendrik@askra.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113600>
2017-05-22 15:27:17 +02:00
Nicolas Goaziou c2f4eec5dc `org-fill-paragraph' handles region
* lisp/org.el (org-fill-element): New function.
(org-fill-paragraph): Use new function.  Also handle region, when
called interactively.

* testing/lisp/test-org.el (test-org/fill-element): Renamed from
  test-org/fill-paragraph.  Update tests.

Reported-by: Oskar Kvist <oskar.kvist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113542>
2017-05-22 15:02:34 +02:00
Nicolas Goaziou b3088eea3f Update a test
* testing/lisp/test-org.el (test-org/refile-get-targets): Update test.
2017-05-22 08:26:22 +02:00
Nicolas Goaziou 36a091fe67 Add test for `org-refile-get-targets'
* testing/lisp/test-org.el (test-org/refile-get-targets): Add test.
2017-05-22 08:21:50 +02:00
Nicolas Goaziou f335c3517d Add tests for org-refile-get-targets
* testing/lisp/test-org.el (test-org/refile-get-targets): New test.

Based on a patch from Sebastian Reuße <seb@wirrsal.net>.
2017-05-22 02:23:40 +02:00
Kyle Meyer 23ac37da7c Merge branch 'maint' 2017-05-21 14:54:59 -04:00
Kyle Meyer 0de7ad0430 org-store-link: Don't roll C-u behavior into C-u C-u behavior
* lisp/org.el (org-store-link): When a double C-u prefix argument is
given, do not reverse the meaning of the org-context-in-file-links
option.
* testing/lisp/test-org.el (test-org/store-link): Add tests.

This allows the user to fall back to the core link storing functions
without also reversing their org-context-in-file-links preference,
because wanting to do the former does not mean a user also wants to do
the latter.

Reported-by: York Zhao <gtdplatform@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-05/msg00254.html>
2017-05-21 14:52:30 -04:00
Nicolas Goaziou 8b79f8c91b Merge branch 'maint' 2017-05-21 11:09:02 +02:00
Nicolas Goaziou 39b3f45a7d org-colview: Fix {X%} and {X/} on recursive summaries
* lisp/org-colview.el (org-columns--summary-checkbox-count):
(org-columns--summary-checkbox-percent): Handle own output for higher
level summaries.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add tests.
2017-05-21 11:08:11 +02:00
Nicolas Goaziou d71e708fe3 Merge branch 'maint' 2017-05-20 22:13:12 +02:00
Nicolas Goaziou ec5df01bd8 org-colview: Properly apply operator format strings on leaf nodes
* lisp/org-colview.el (org-columns--displayed-value): When value is
a number and a format string is specified, apply it.
* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Add tests.

Reported-by: Hendrik Tews <hendrik@askra.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113547>
2017-05-20 22:11:45 +02:00
Nicolas Goaziou dbe2424b07 Adjust `org-at-timestamp-p' behavior
* lisp/org.el (org-at-timestamp-p): Change optional argument
  behaviour.  Remove interactive call.
(org-follow-timestamp-link):
(org-get-repeat):
(org-auto-repeat-maybe):
(org-time-stamp):
(org-timestamp-up-day):
(org-timestamp-down-day):
(org-toggle-timestamp-type):
(org-timestamp-change):
(org-goto-calendar):
(org-date-from-calendar):
(org-shiftup):
(org-shiftdown):
(org-shiftright):
(org-shiftleft):
(org-org-menu):
(org-fill-paragraph-with-timestamp-nobreak-p):
(org-shiftcontrolup):
(org-shiftcontroldown):
* lisp/org-agenda.el (org-agenda-date-later):
(org-agenda-date-prompt):
* lisp/org-clock.el (org-clock-timestamps-change):
* lisp/org-mouse.el (org-mouse-delete-timestamp):
(org-mouse-context-menu):
* lisp/org-table.el (org-table-copy-down): Update callers.

* testing/lisp/test-org.el (test-org/at-timestamp-p): Add tests.
2017-05-14 10:54:25 +02:00