Commit Graph

119 Commits

Author SHA1 Message Date
Ihor Radchenko 5af0625113
org-table-eval-formula: Fix parsing of mode string when formula has ;
* lisp/org-table.el (org-table-eval-formula): Use more strict regexp
to detect mode string in formulas.
* testing/lisp/test-org-table.el (test-org-table/eval-formula): Add
test.

Reported-by: Nick Dokos <ndokos@gmail.com>
Link: https://orgmode.org/list/87ply5v1gj.fsf@localhost
2024-05-19 13:10:49 +02:00
Ihor Radchenko bd5665e017
org-table-make-reference: Address compiler warning
* lisp/org-table.el (org-table-make-reference): Drop branch of `if'
unused during runtime.  This preserves _interactive_ behavior.
* testing/lisp/test-org-table.el (test-org-table/org-table-make-reference/mode-string-none):
(test-org-table/org-table-make-reference/mode-string-N): Fix tests to
check for the existing _interactive_ behavior.  When running make
test (eq "" "") happens to return t and tests were passing previously
by accident despite actual behavior during user session being
different. Fix the tests to avoid breaking changes in the user
experience.

Link: https://list.orgmode.org/orgmode/20230827214320.46754-1-salutis@me.com/
2024-05-09 11:55:29 +03:00
Ihor Radchenko 731d16f9e9
org-table-to-lisp: Preserve text properties
* lisp/org-table.el (org-table-to-lisp): When parsing table, keep text
properties.  These text properties are required to calculate table
alignment with invisible text.
* testing/lisp/test-org-table.el (test-org-table/align): Add new test.

Reported-by: Kostadin Ninev <dinkonin@gmail.com>
Link: https://orgmode.org/list/1709041784097.2987395179.620232376@gmail.com
2024-02-29 14:23:37 +03:00
Ihor Radchenko 03b383df8b
ox-latex: Remove org-latex-line-break-safe
This reverts commit 3f60acff77 and
subsequent relevant comments.

* lisp/ox-latex.el (org-latex-line-break-safe): Remove constant.  The
\\[0pt] is actually not safe to use in some scenarios. We use a
different approach to avoid plain text [...] being interpreted as
LaTeX optional argument - we escape [ like {[}; that's what pandoc
does.
(org-latex-clock):
(org-latex-line-break):
(org-latex-plain-text):
(org-latex-planning):
(org-latex--org-table):
(org-latex--math-table):
(org-latex-table-row):
(org-latex-verse-block):
* testing/lisp/test-org-table.el (test-org-table/to-latex):
* testing/lisp/test-ox-latex.el (test-ox-latex/verse):
(test-ox-latex/longtable): Remove references to
`org-latex-line-break-safe'.
* etc/ORG-NEWS (=ox-latex=: ~org-latex-line-break-safe~ is removed):
Announce removal.
* lisp/org-compat.el (org-latex-line-break-safe): Make obsolete.

Link: https://orgmode.org/list/878r4jg37s.fsf@posteo.net
2024-01-31 12:35:29 +01:00
Ihor Radchenko 173b5de0ec
testing: Re-introduce more useful new tests instead of deleted dupllicates
* testing/lisp/test-ol.el (test-org-link/store-link):
* testing/lisp/test-org-table.el (test-org-table/get-field):
* testing/lisp/test-org.el (test-org/auto-fill-function): Add modified
version of the removed test duplicates, according to their likely
original intention.

Link: https://orgmode.org/list/87cz0wyw9m.fsf@localhost
2023-08-08 15:40:59 +03:00
Ilya Chernyshov fe85d61a92
testing: Delete duplicate tests
* testing/lisp/test-ol.el (test-org-link/store-link): Delete a duplicate test.

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/properties): Delete a duplicate test.

* testing/lisp/test-org-element.el (test-org-element/link-parser,
test-org-element/timestamp-parser): Delete duplicate tests.

* testing/lisp/test-org-table.el (test-org-table/get-field): Delete a duplicate test.

* testing/lisp/test-org.el (test-org/auto-fill-function): Delete a duplicate test.
2023-08-08 15:33:06 +03:00
Ihor Radchenko 989cc51499
Prefer "timestamp" over "time-stamp"
* lisp/org.el (org-time-stamp-formats):
(org-timestamp-formats):
(org-time-stamp-rounding-minutes):
(org-timestamp-rounding-minutes):
(org-time-stamp-custom-formats):
(org-timestamp-custom-formats):
(org-time-stamp):
(org-timestamp):
(org-time-stamp-inactive):
(org-timestamp-inactive):
(org-insert-time-stamp):
(org-insert-timestamp):
(org-toggle-time-stamp-overlays):
(org-toggle-timestamp-overlays):
(org-time-stamp-to-now):
(org-timestamp-to-now):
* lisp/ox.el (org-export-time-stamp-file):
(org-export-timestamp-file): Rename using "timestamp" term, keeping
the old name as alias.
* doc/org-manual.org: Update all the uses, adding #+findex and
 #+vindex entries.  Keep the alias names for searchability.

Adjust all the callers.

The following "time-stamp" uses are unchanged:
1. `org-time-stamp-format' where obsolete and _different_ function
   `org-timestamp-format' still exists.
2. :time-stamp-file property in export INFO plist.  Changing this
   would be breaking.
3. ORG-NEWS remains unchanged.
2023-04-30 13:48:52 +02:00
Ihor Radchenko c72d5ee840
org-table-convert-refs-to-rc: Fix failing test
* lisp/org-table.el (org-table-convert-refs-to-an): Leave $0
references (current row) unchanged during conversion.
*
testing/lisp/test-org-table.el (test-org-table/org-table-convert-refs-to-an/2):
Re-enable the failing test.
2022-11-25 14:45:09 +08:00
Ihor Radchenko f7831cc9ac
* testing/lisp/test-org-table.el: Uncomment working test
(test-org-table/org-table-convert-refs-to-rc/3): Uncomment test that
is no longer broken.
2022-11-24 19:42:15 +08:00
Ihor Radchenko 5a6d00a3a3
test-org-num.el: Do not rely on fixed overlay order in `overlays-in'
* testing/lisp/test-org-num.el (test-org-num/max-level):
(test-org-num/skip-numbering):
(test-org-num/update):
* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
Do not expect specific overlay order in the return value of
`overlays-in'.  The order is not guaranteed by the docstring and has
been changed in Emacs 29.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59067
2022-11-09 10:12:44 +08:00
Ihor Radchenko b93a61af9c
org-latex-line-break-safe: Use safer value of "\\[0pt]"
* lisp/ox-latex.el (org-latex-line-break-safe):
(org-latex-table-row):
Change \empty ending to explicit optional argument.  \empty still has
undesired side effects in some cases.

* testing/lisp/test-org-table.el (test-org-table/to-latex):
* testing/lisp/test-ox-latex.el (test-ox-latex/verse): Update tests.

Reported-by: Juan Manuel Macías <maciaschain@posteo.net>
Link: https://orgmode.org/list/87o7u9rz1a.fsf@posteo.net
2022-10-29 10:34:05 +08:00
Max Nikulin 892df429f4
ox-latex: Use \empty instead of \relax after \\
* lisp/ox-latex.el (org-latex-line-break-safe, org-latex-table-row):
* testing/lisp/test-org-table.el (test-org-table/to-latex): Use \empty
instead of \relax to prevent interpreting following "*" and "[" as
optional parts of \\*[LENGTH] command.

Fix regression introduced by 3f60acff77. \\\relax\hline caused
misaligned \noalign error. Org markup:

    | a |
    |---|

\hline is allowed only immediately after \cr while \relax has some side
effects. Hope, \empty just expands to nothing.

Those who used \\ optional argument to adjust amount of space between
lines may add the following tricks:

    First,\\
    @@latex:{\vskip1em}@@second.

    | First                               |
    | @@latex:\noalign{\vskip1em}@@second |

Reported in
gerard.vermeulen, Wed, 12 Oct 2022 03:15:49 +0000.
https://list.orgmode.org/784cf8be450b7d676ddd60214cc847db@posteo.net
2022-10-14 10:27:14 +08:00
Ihor Radchenko 3f60acff77
ox-latex: Protect [...] after \\ to be interpreted as LaTeX argument
* lisp/ox-latex.el (org-latex-linebreak-safe): New constant holding
safe version of LaTeX line break.
(org-latex-table-matrix-macros):
(org-latex-clock):
(org-latex-line-break):
(org-latex-plain-text):
(org-latex-planning):
(org-latex--org-table):
(org-latex--math-table):
(org-latex-table-row):
(org-latex-verse-block): Use the new constant.

* testing/lisp/test-org-table.el (test-org-table/to-latex): Update
tests.

Reported-by: Stewart Thomas <sjt015@bucknell.edu>
Link: https://orgmode.org/list/ce760fc3-5aae-144d-2d02-7dea215f73fc@gmail.com
2022-10-11 11:32:52 +08:00
Stefan Monnier 1a5e3f931c
testing: Make all files use `lexical-binding`
Mainly, add the corresponding cookie, but also add various `require`s
so that the compiler knows which vars should be trated as dynbound.
This does not fix all the warnings, but does try to eliminate
all those about "unused" variables.  For the variables truly unused,
the patch usually adds an underscore to their name to silence the warning.

Some of the fixes affect files which already used `lexical-binding`.
Not sure why the test worked before: maybe because the tests were run
without compiling them first (which could cause some of the
missing `require`d packages to be autoloaded before we got to the
problematic code, thus hiding the problem)?

I found some suspicious code, for which I added FIXMEs.

There are also a few changes to the main files.

* lisp/org-protocol.el (org-protocol-check-filename-for-protocol):
Don't call `server-edit` if it's not yet defined.  [ Needed to get
the tests to pass. ]

* lisp/ob-core.el (org-babel-temporary-directory)
(org-babel-temporary-stable-directory): Always define (and use nil
if we don't want to create a directory for it).  Simplify the code based
on the fact that (defvar V E) only evaluates E if V is not yet `boundp`.
(org-babel-temp-file, org-babel-temp-stable-file)
(org-babel-remove-temporary-directory)
(org-babel-remove-temporary-stable-directory): Adjust accordingly.

* lisp/org.el (org-log-beginning): Add FIXME.

* testing/org-test.el: Require `org` and `org-id`.
(org-id-locations-file): Don't `defconst` it.
(org-test-at-id, org-test-in-example-file, org-test-at-marker)
(org-test-with-temp-text, org-test-with-temp-text-in-file): Move edebug
specs into `declare` (and simplify them).
(org-test-with-tramp-remote-dir--worker): Declare dynbound tramp vars.
(org--compile-when): Fix quoting of `exp`.
(org-test-load): Tweak regexps.

* testing/org-batch-test-init.el: Tweak regexp, remove dead code and
add a FIXME about it.

* testing/lisp/test-ox.el: Require `ox` instead of
erroring out if it's not already loaded.  Also require `org-inlinetask`.
(org-test-with-parsed-data): Silence warnings when `info` is not used.
(test-org-export/bind-keyword): Add FIXME.

* testing/lisp/test-ox-publish.el: Require `org-test` and `ox-publish`.
(test-org-publish/resolve-external-link): Expose lambdas to
the compiler.  Remove unused var `ids`.
(test-org-publish/get-project-from-filename): Remove unused var `file`.

* testing/lisp/test-org.el: Require `org-macs`, `org`,
`org-inlinetask`, `org-refile`, and `org-agenda`.
(test-org/org-read-date): Declare `org-time-was-given` as dynbound.
(test-org/set-regexps-and-options): Add FIXME.

* testing/lisp/test-org-timer.el: Require `org-timer`.

* testing/lisp/test-org-table.el: Require `ox`.

* testing/lisp/test-org-protocol.el: Require `org-protocol` instead of
erroring out if it's not already loaded.  Also require `capture`, and
add missing `provide` statement.

* testing/lisp/test-org-pcomplete.el: Require `org`.

* testing/lisp/test-org-list.el: Require `org-list` and `org`.

* testing/lisp/test-org-lint.el: Require `org-footnote` and `org-lint`.

* testing/lisp/test-org-footnote.el: Require `org-footnote`.

* testing/lisp/test-org-element.el: Require `org-element` instead of
erroring out if it's not already loaded.  Also require `org` and
`org-inlinetask`.

* testing/lisp/test-org-duration.el: Require `org-duration`.

* testing/lisp/test-org-datetree.el: Require `org-datetree`.

* testing/lisp/test-org-colview.el: Require `org-colview`,
`org-duration`, and `org-inlinetask`.

* testing/lisp/test-org-clock.el: Require `org-duration` and `org-clock`.

* testing/lisp/test-org-archive.el: Require `org-archive`.

* testing/lisp/test-org-agenda.el
(test-org-agenda/bulk-custom-arg-func): Add FIXME.

* testing/lisp/test-ol.el: Require `ol` and `org-id`.
(test-org-link/store-link): Declare `org-store-link-props` and add FIXME.

* testing/lisp/test-oc.el (test-org-cite/export-capability): Add FIXME.

* testing/lisp/test-ob.el: Require `ob-core`, `org-src`, `ob-ref`,
and `org-table`.
(test-ob/eval-header-argument): Rename `foo` to `test-ob--foo` and
declare it as dynbound.
(test-ob/blocks-with-spaces, test-ob/specific-colnames): Add FIXME.
(test-ob/noweb-expansions-in-cache):
Declare `noweb-expansions-in-cache-var` as dynbound.

* testing/lisp/test-ob-tangle.el: Require `org` and `ob-tangle`.

* testing/lisp/test-ob-shell.el:
* testing/lisp/test-ob-python.el: Require `ob-core`.

* testing/lisp/test-ob-lob.el: Require `ob-lob`.
(temporary-value-for-test): Declare as dynbound.

* testing/lisp/test-ob-plantuml.el: Require `ob-plantuml` instead of
erroring out if it's not already loaded.
* testing/lisp/test-ob-lilypond.el: Require `ob-lilypond` instead of
erroring out if it's not already loaded.  Use `with-current-buffer`.

* testing/lisp/test-ob-julia.el: Require `ob-core`.

* testing/lisp/test-ob-java.el (org-babel-temporary-directory):
Remove dead code now that `org-babel-temporary-directory` is always bound.

* testing/lisp/test-ob-exp.el: Require `ob-exp`, `org-src`, and `org-test`.
(ob-exp/evaluate-all-executables-in-order):
Declare `*evaluation-collector*` as dynbound.

* testing/lisp/test-ob-emacs-lisp.el (ob-emacs-lisp/dynamic-lexical-edit)
(ob-emacs-lisp/dynamic-lexical-execute):
Rename dynbound var to `ob-emacs--x` and declare it as such.

* testing/lisp/test-ob-R.el: Require `ob-core`.
(ess-ask-for-ess-directory, ess-history-file): Declare vars.
2022-09-15 19:17:19 +08:00
Stefan Kangas 8cc992f7b2 Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
Daniele Nicolodi 15469774dd org-table: Add mode flag to enable Calc units simplification mode
* org-table.el (org-table-eval-formula): Add the `u` mode flag to
enable Calc's units simplification mode.

* test-org-table.el (test-org-table/mode-string-u): Add Unit test for
the new mode flag.

* org-manual.org: Document new mode flag.
2020-11-24 20:59:39 -05:00
mfrasca 73e367fca4 table: Allow collapsing header into single line
* lisp/org-table.el (org-table-collapse-header): New function.

* lisp/org-plot.el (org-plot/gnuplot): Use org-table-collapse-header
and trust there will be no more leading `hline' symbols in lisp table.

* testing/lisp/test-org-table.el (test-org-table/to-lisp):
Adding tests to already existing to-lisp function.
(test-org-table/collapse-header): Adding tests to new
collapse-header function.

* testing/lisp/test-ox.el (test-org-export/has-header-p): Testing
exporting table with multi-line header.
2020-06-28 23:02:26 +02:00
Nicolas Goaziou e3a7247b68 table: Gracefully align hrule-only tables
* lisp/org-table.el (org-table-align): Try to align the table even
when it only consists of horizontal rules.
* testing/lisp/test-org-table.el (test-org-table/align): Add test.
2020-06-15 21:34:00 +02:00
Nicolas Goaziou 756ddff9e3 table: Small fix to column deletion
* lisp/org-table.el (org-table-delete-column): Do not assume row ends
right after the last vertical line.  Do not use `looking-back'.
* testing/lisp/test-org-table.el (test-org-table/delete-column): Add
test.
2020-04-18 18:33:07 +02:00
Marco Wahl bb9dfdafeb org-table: Make column delete consistent with row delete
* lisp/org-table.el (org-table-delete-column): Stay in the column at
delete.  Exceptionally allow column delete when point is at eol
immediately to the right of a cell seperator.

A hint by Eric S Fraga led to this commit.
https://lists.gnu.org/archive/html/emacs-orgmode/2020-04/msg00283.html
2020-04-18 16:16:02 +02:00
Marco Wahl 22d2b0ac84 org-table: Insert column at point
* lisp/org-table.el (org-table-insert-column): Adjust the function to
insert the column at point (and not to the right.)

Org-manual, ORG-NEWS and testing are changed accordingly.
2020-04-18 00:13:24 +02:00
Marco Wahl dc53b59a25 test-org-table: Test insert column with formula in place
*
testing/lisp/test-org-table.el (test-org-table/insert-column-with-formula):
New test.
2020-03-30 23:21:45 +02:00
Nicolas Goaziou 24daf224c0 Fix test
* testing/lisp/test-org-table.el (test-org-table/copy-down): Fix test.
2019-07-09 12:03:32 +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 ab311b85ae Merge branch 'maint' 2019-04-13 09:43:32 +02:00
Nicolas Goaziou 222408d70a org-table: Prevent expanding columns upon applying formulas
* lisp/org-table.el (org-table-recalculate): Prevent expanding columns
  upon applying formulas.
* testing/lisp/test-org-table.el (test-org-table/shrunk-columns): Add
  test.

Reported-by: Nick Dokos <ndokos@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-04/msg00079.html>
2019-04-13 09:40:27 +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
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 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
Sebastian Reuße 88bf8aef28 org-table-sort-lines: Fix case-sensitive sorting
* org-table.el (org-table-sort-lines): Fix case sensitive sorting,
improve docstring.
* test-org-table.el (test-org-table/sort-lines): Enforce C locale when
testing alphabetic sorting.

‘sort-subr’ ignores ‘sort-fold-case’ when a predicate is provided. To
correctly handle case-sensitivity, we now bake it into the predicate.

Since we are now sorting according to the user’s locale, WITH-CASE
will not make a difference in most instances, since most locales
always sort case-insensitively (cf. how GNU sort ignores the ‘-f’
switch).  We now mention this in the function docstring.

In order to meaningfully test case-sensitive sorting, we now enforce
the C locale in the respective unit test.
2018-03-13 09:09:54 +01:00
Sebastian Reuße 89ec5e198b Fix org-table-sort-lines test
* test-org-table.el (test-org-table/sort-lines): Fix and improve
testcase.

Sorting and reversing «a C b» should result in «C b a», not in «b a
C».  This test did not fail previously only because
org-table-sort-lines had an issue whereby sorts were always
case-sensitive.
2018-03-13 09:09:41 +01:00
Nicolas Goaziou 58da7d4d17 org-table: Fix shrunk columns on hlines
* lisp/org-table.el (org-table--shrunk-field): Fix function when on
  a hline.
* testing/lisp/test-org-table.el (test-org-table/shrunk-columns): Add
  tests.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00231.html>
2018-02-14 18:48:48 +01:00
Nicolas Goaziou 3558e6e835 Merge branch 'maint' 2018-02-05 15:37:15 +01:00
Tim Landscheidt 61a885a399 Make manual and URL links in docstrings clickable 2018-02-05 15:27:12 +01:00
Nicolas Goaziou 33a9eef11f Allow editing partially shrunk columns
* lisp/org-table.el (org-table-with-shrunk-field): New macro.
(org-table-get-field):
(org-table-toggle-column-width): Use new macro.
(org-table--shrunk-field): Update function.
(org-table--shrink-field): When there is a width cookie, leave first
characters editable.

* lisp/org.el (org-self-insert-command):
(org-delete-backward-char):
(org-delete-char): Small refactoring.  Handle shrink overlays.

* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
  Update tests.
2018-01-25 23:57:11 +01:00
Nicolas Goaziou 9cf9f56ff6 org-table: Fix `org-table-current-column' on hlines
* lisp/org-table.el (org-table-current-column): Return a meaningful
  value also on hlines.
(org-table-toggle-column-width): Use `org-table-current-column'
instead of re-inventing wheel.

* testing/lisp/test-org-table.el (test-org-table/current-column): New
  test.
2018-01-25 22:55:53 +01:00
Nicolas Goaziou b65fe0f7a2 Merge branch 'maint' 2018-01-07 10:56:02 +01:00
Nicolas Goaziou 0c93296f83 org-table: Obey to `org-table-formula-create-columns'
* lisp/org-table.el (org-table-recalculate): Return an error when the
  formula cannot create a necessary column.
(org-table-formula-create-columns): Fix docstring.
* testing/lisp/test-org-table.el (test-org-table/field-formula-outside-table):
  Fix tests.
2018-01-07 10:55:30 +01:00
Nicolas Goaziou 2fb65b73b6 test-org-table: Tiny refactoring
* testing/lisp/test-org-table.el (test-org-table/org-table-make-reference/mode-string-EL):
(test-org-table/org-table-make-reference/mode-string-E):
(test-org-table/org-table-make-reference/mode-string-EN):
(test-org-table/org-table-make-reference/mode-string-L):
(test-org-table/org-table-make-reference/mode-string-none):
(test-org-table/org-table-make-reference/mode-string-N): Tiny
refactoring.
2017-12-30 00:24:01 +01:00
Nicolas Goaziou b8d473a04f org-table: Insert new column to the right instead of the left
* lisp/org-table.el (org-table-insert-column): Insert new column to
  the right instead of the left.

* testing/lisp/test-org-table.el (test-org-table/insert-column): New
  test.
2017-11-19 23:22:16 +01:00
Nicolas Goaziou 8ff3673dfc Merge branch 'maint' 2017-11-15 17:41:48 +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
Nicolas Goaziou 17013d6f38 Remove duplicate test
* testing/lisp/test-org-table.el (test-org-table/align): Remove test.
2017-09-08 13:14:55 +02:00
Nicolas Goaziou 70d2b3c96f org-table: Obey <c> cookie when aligning a table
* lisp/org-table.el (org-table--align-field): New function.
(org-table-align): Use new function.  Refactor code.
(org-table-justify-field-maybe): Use new function.
(org-table-get-remote-range): Remove duplicate bindings.

* doc/org.texi (Column width and alignment): Remove footnote.

* testing/lisp/test-org-table.el (test-org-table/align): New test.
2017-09-06 15:21:20 +02:00
Nicolas Goaziou 882f3f3fc0 org-table: Change behavior of `org-table-toggle-column-width'
* lisp/org-table.el (org-table-toggle-column-width): Change behavior
  of `org-table-toggle-column-width'.
(org-table-shrink): Allow optional arguments.

* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
  Update tests.
2017-09-06 15:18:37 +02:00
Nicolas Goaziou 6d6a30d4cd org-table: Implement shrunk columns
* lisp/org-table.el (org-table-shrunk-column-indicator): New variable.
(org-table-with-shrunk-columns): New macro.
(org-table--shrunk-field):
(org-table--list-shrunk-columns):
(org-table--shrink-field):
(org-table--read-column-selection):
(org-table--expand-all-columns):
(org-table-toggle-column-width): New functions.

(org-table-align):
(org-table-get-field):
(org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-move-row):
(org-table-insert-row):
(org-table-insert-hline):
(org-table-kill-row):
(org-table-sort-lines): Use new functions.

(org-table-overlay-coordinates):
(org-table-toggle-coordinate-overlays): Tiny refactoring.

* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
(test-org-table/shrunk-columns): New tests.
2017-09-06 15:18:37 +02:00
Nicolas Goaziou bae41a277e org-table: Fix sorting with times > 100 hours
* lisp/org-table.el (org-table-sort-lines): Fix regexp.  Also test
  durations.

* testing/lisp/test-org-table.el (test-org-table/sort-lines): Update
  tests.  Add a new one.
2017-08-25 00:06:27 +02:00
Nicolas Goaziou b0776e39b5 org-table: Small refactoring
* lisp/org-table.el (org-table-previous-field): Small refactoring.

* testing/lisp/test-org-table.el (test-org-table/previous-field): New
  test.
2017-08-02 10:35:57 +02:00
Nicolas Goaziou 64cbcb1bff Merge branch 'maint' 2017-07-01 10:34:01 +02:00
Nicolas Goaziou 79f29b490e org-table: Add tests
* testing/lisp/test-org-table.el (test-org-table/move-row-down):
(test-org-table/move-row-up): New tests.
2017-07-01 10:30:45 +02:00