* lisp/org-table.el (orgtbl-setup): Hijack DEL key. We also hijack
`delete-backward-char' but major modes derived from `prog-mode'
usually bypass it.
Reported-by: Alex G <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107232>
* lisp/org-table.el (orgtbl-self-insert-command): Properly overwrite
white spaces when there is room for it. This is on par with what
`org-self-insert-command' does in Org tables.
Reported-by: Alex <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107112>
* lisp/org-table.el (org-table-eval-formula): Nowadays, Calc is
installed with Emacs, so there is no need to specify this. Also
remove hard-coded "C-u".
(org-table-recalculate): Fix code typo.
* lisp/org-table.el (org-table-eval-formula): Expand first and last
references into proper fields coordinates before replacing ranges.
Reported-by: Pablo S. Casas <pabloscasas@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105895>
* lisp/org-agenda.el (org-agenda-show-the-flagging-note):
* lisp/org-footnote.el (org-footnote-goto-definition):
* lisp/org-table.el (org-table-edit-formulas): Fix straight quotes
rendered as curvy quotes in echoes messages (in emacs 25.1).
* lisp/org-table.el (org-table-align): Fix straight quotes rendered as
curvy quotes in help echo (in emacs 25.1).
* lisp/org-protocol.el (org-protocol-create-for-org):
* lisp/org-table.el (org-table-sum): Minor reformatting.
The below thread discusses why these changes were needed especially when
using emacs 25.1 or newer emacsen (that added support for rendering
back-quotes and straight quotes as left/right curvy quotes by default):
http://thread.gmane.org/gmane.emacs.orgmode/105594
Fix the quote style displayed when key-bindings are shown in
the echo via (message .. (substitute-command-keys ..)).
So below will render that single quote as curly.
(message "C-c '")
The fix (Reference:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00234.html)
is to print that quote verbatim using the "%s" modifier:
(message "%s" "C-c '")
Also an help-echo text property value was fixed in `org-table-align'.
`substitute-command-keys' should not be used in that. Instead \\[COMMAND]
should be used directly in the string.
* lisp/org-table.el (org-table-show-reference): Do not move point
outside the table when editing formulas. Fix docstring.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104472>
* lisp/org-table.el (org-table-current-field-formula): Column formulas
are stored with a leading dollar sign. Also raise an error when no
field applies, unless NOERROR is non-nil.
* lisp/org-table.el (org-table-eval-formula): Remove unnecessary error.
* lisp/org-table.el (org-table-recalculate): Expand "$<" without
returning an error. Small refactoring.
* testing/lisp/test-org-table.el (test-org-table/first-rc): New test.
Reported-by: Stefan Nobis <stefan-ml@snobis.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/103693>
* lisp/org-table.el (org-table-eval-formula): Properly parse named
fields when indentation of current line ends with a TAB character.
* testing/lisp/test-org-table.el (test-org-table/tab-indent): New test.
Reported-by: Piotr Gajewski <pg7@outlook.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103290>
* lisp/org-table.el (org-table-get-formula):
(org-table-store-formulas): Column formulas references are stored along
with their dollar-sign since "Fix `org-table-get-range' with column
formulas". Update functions accordingly.
Reported-by: John Hendy <jw.hendy@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103056>
* lisp/org-table.el (org-table-analyze): Fix incorrect replacement for
"$>" reference when the table ends on a hline.
* testing/lisp/test-org-table.el (test-org-table/end-on-hline): New
test.
* lisp/org-table.el (orgtbl-to-generic): Make sure "ox.el" is loaded
before converting a radio table.
Reported-by: Dave Marquardt <davemarq@linux.vnet.ibm.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101642>
Protect apostrophes not covered by the last backport. Convert
expressions like '(...) to \\='(...) and symbols written as 'name to
`name'. (In addition to ensuring the correct display, the latter also
improves consistency with many Org docstrings.)
If these aren't protected, Emacs 25 may display them as curved quotes in
the help buffer, depending on the value of text-quoting-style.
These changes are the combination of the commits below (in order
applied). Unlike other backports, these are applied in one commit
because they are closely related and because some of the later commits
reverse changes in earlier commits. Changes to message and help quote
display for Emacs 25 seem to be here to stay. The quote protections are
required to ensure grave accents and apostrophes are displayed as
intended in Emacs 25, and they should not affect earlier versions.
Quoting fixes in lisp/org
6cd2629bd1b3ce77d29ac28e29237c94a4197116
Paul Eggert
Mon Aug 31 00:29:40 2015 -0700
More-conservative ‘format’ quote restyling
fbb5531fa11d13854b274d28ccd329c9b6652cfc
Paul Eggert
Sun Aug 23 22:39:06 2015 -0700
Prefer directed to neutral quotes
875a5d0ead827d3da32ecbd30e739a29f07bbc87
Paul Eggert
Mon Aug 24 23:57:25 2015 -0700
Escape ` and ' in doc
19532d147b431a4fe34f088d6de07891c48e2c5c
Paul Eggert
Tue Sep 1 18:23:21 2015 -0700
Fix some more docstring etc. quoting problems
26bd978d87dfbf9baa115cd961a67d42b416c4bf
Paul Eggert
Thu Sep 3 15:32:54 2015 -0700
Go back to grave quoting in source-code docstrings etc.
6afef3f6ca2f3009c722b84e249903b7f807b044
Paul Eggert
Mon Sep 7 16:09:27 2015 -0700
* lisp/org-table.el (orgtbl-to-generic): Export macros as-is, even if
they are undefined.
* testing/lisp/test-org-table.el (test-org-table/to-generic): Add test.
Radio tables are now using a minimal set-up for export. In particular,
no macro is expanded, and no Babel code is executed. If any of these is
needed, use `org-export-string-as' or `org-export-region-as' instead.
Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100621>
* lisp/org-table.el (org-table-get-range): Use correct values to extract
range. This is important when range is defined backwards (e.g.,
@-I..@-II).
Reported-by: Sebastien Vauban
<http://permalink.gmane.org/gmane.emacs.orgmode/99430>
* lisp/org-table.el (org-table-auto-recalculate-regexp):
(org-table-recalculate-regexp):
(org-table-calculate-mark-regexp):
(org-table-column-names):
(org-table-column-name-regexp):
(org-table-local-parameters):
(org-table-named-field-locations):
(org-table-current-line-types):
(org-table-current-begin-pos):
(org-table-current-ncol):
(org-table-dlines):
(org-table-hlines): Improve docstrings.
(org-table-current-begin-line): Remove variable.
(org-table-save-field): New macro.
(org-table-get-specials): Remove function.
(org-table-analyze): New function, renamed from
`org-table-get-specials'.
(org-table-find-row-type): Remove function.
(org-table--row-type): New function, renamed from
`org-table-find-row-type'.
(org-table-align): Use new macro.
(org-table-field-info):
(org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-sort-lines):
(org-table-paste-rectangle):
(org-table-wrap-region):
(org-table-current-field-formula):
(org-table-get-formula):
(org-table-maybe-recalculate-line):
(org-table-eval-formula):
(org-table-get-range):
(org-table--descriptor-line):
(org-table-recalculate):
(org-table-expand-lhs-ranges):
(org-table-edit-formulas):
(org-table-show-reference):
(org-table-get-remote-range): Apply changes above. Refactor code.
(org-table-check-inside-data-field):
(org-table-current-column):
(org-table-current-dline):
(org-table-line-to-dline):
(org-table-copy-region):
(org-table-rotate-recalc-marks):
(org-table-fedit-post-command):
(org-table-fedit-convert-buffer):
(org-table-highlight-rectangle): Refactor code.
(org-table-goto-field): New function.
* lisp/org-capture.el (org-capture-place-table-line): Apply change made
to table internals.
The point of this commit is to remove dependency on `org-current-line'
and `org-goto-line', which are both expensive in large buffers. Now,
lines are relative to the beginning of the current table instead of
global (i.e., relative to the beginning of the buffer).
* lisp/org-table.el (org-table-border-regexp): Improve docstring.
(org-table-begin):
(org-table-end): Assume point is in a table already. In this case,
using parser is not necessary anymore.
* lisp/org-table.el (org-table-colgroup-line-p,
org-table-cookie-line-p): Remove functions.
* etc/ORG-NEWS: Signal removal.
These functions were used in the pre Org 8.0, specifically in HTML
export back-end. They are no longer accurate since they tolerate some
HTML entities whereas Org syntax doesn't.
* lisp/org-table.el (orgtbl-to-generic): Leading and trailing spaces
could be significant, so do not trim result. However, remove the
final newline character.
Reported-by: lom pik <lompikvoila@gmail.com> <>
<http://permalink.gmane.org/gmane.emacs.orgmode/99171>
* lisp/org-table.el (org-table-relative-ref-may-cross-hline): Remove
variable.
* etc/ORG-NEWS: Document removal.
This variable was declared obsolete in August 2009. See
2cc99fbb0a.
* lisp/org-table.el (org-table-TBLFM-begin-regexp): Take into
consideration that table lines are not required to end with "|".
(org-table-calc-current-TBLFM): Properly clean markers at the end of
the process.
(org-table-TBLFM-begin): Small refactoring.
* lisp/org.el (org-at-TBLFM-p): Prevent false positives.
Suggested-by: Oleg Sivokon <olegsivokon@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97461>
* lisp/org-table.el (org-table-end): Do not return a maker.
(org-table-align):
(org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-convert):
(org-table-recalculate): Create needed marker.
Creating a marker was not documented, and not always needed.
`copy-marker' should be used when they are. Markers not deactivated
slow down editing.
* lisp/org.el (org-do-sort): Remove function.
* lisp/org-table.el (org-table--do-sort): New function.
(org-table-sort-lines): Use new function.
`org-do-sort' is really a helper function for `org-table-sort-lines',
which applies exclusively on tables.
* lisp/org.el (org-do-sort): Implement the ?f and ?F sorting options
to allow user-defined table sorting. Update the DOC string.
* lisp/org-table (org-table-sort-lines): Add the GETKEY-FUNC and
COMPARE-FUNC optional parameters and pass them to the call to
`org-do-sort'. Update the DOC string.
* doc/org.texi (org-table-sort-lines): Update documentation to reflect
the addition of the ?f and ?F options.
This patch implements user-defined extraction and comparison functions
for table sorting. Thanks to Nicolas Goaziou for helpful suggestions.
This patch was discussed on the Org Mode mailing list:
http://article.gmane.org/gmane.emacs.orgmode/93334
* lisp/org-table.el (org-table-recalculate): Removed message for start of
processing. When ALL is t, messages are printed at most once per second.
TINYCHANGE
* lisp/org-table.el (org-table-convert-region-max-lines): New
defcustom.
(org-table-convert-region): Use it.
This is useful primarily for babel results. If a large table-like
object is returned by a code block, this function will become bogged
down in trying to read it, and hang emacs (necessitating a C-g). This
situation most commonly arises when a :results none header has been
omitted. With the patch, the user will not experience a hang, but
rather an error message.
* lisp/org-table.el (org-table-set-constants): Remove function.
* lisp/org.el (org-set-regexps-and-options): Rewrite function. Merge
it with `org-set-regexps-and-options-for-tags'.
(org-set-regexps-and-options-for-tags): Remove function
(org--setup-collect-keywords, org--setup-process-tags): New functions.
(org-mode): Remove `org-set-regexps-and-options-for-tags' call.
(org-agenda-prepare-buffers): Use optimized setup for tags in all
cases. Improve docstring.
(org-make-options-regexp): Make returned regexp more efficient.
* lisp/org-table.el (orgtbl-ctrl-c-ctrl-c): Do not set constants.
Orgtbl provides limited support for Org tables in an arbitrary major
mode. Any Org syntax outside tables, including keywords, cannot be
supported in this environment. Therefore there is no point to look
for CONSTANTS keywords. Moreover, constants can be defined within the
table.
This change allows to move `org-table-set-constants' feature to
`org-set-regexps-and-options' and treat CONSTANTS keyword like any
other keyword (e.g., defining it in a SETUPFILE).
* org.el (org-mode-map): change key-binding from C-c p to C-c " a add
C-c " g key-binding for Gnuplot
(org-tbl-menu): add sub-menu for plotting featuring Gnuplot and ascii
plot
* org-table.el (orgtbl-setup): add sub-menu for plotting featuring
Gnuplot and ascii plot
* org-table.el (org-table-formula-create-columns): New variable.
(org-table-recalculate): Use the new org-table-formula-make-new-cols
customization to control whether org creates new columns when
a formula explicitly targets them.
* lisp/org-table.el (org-table--to-generic-cell): Use
`org-element-interpret' data when parameter :raw is non-nil so
pseudo elements and objects are not ignored.
* testing/lisp/test-org-table.el (test-org-table/to-latex): Add test.
Thanks to Giuseppe Lipari for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/91559
* org-table.el (orgtbl-ascii-plot): Top-level function.
(orgtbl-ascii-draw), (orgtbl-uc-draw-grid), (orgtbl-uc-draw-cont):
Functions which go in table formulas for drawing bars.
* org.el: key binding and menu binding
Thanks to Michael Brand and Nicolas Goaziou for feedback and
enhancements.
This reverts commit 79873390ed.
The fix was wrong and gave rise to a different problem - see
http://thread.gmane.org/gmane.emacs.orgmode/89945
Revert it for now, since there is a workaround for the original
problem and plan on a correct fix in the near future.
* org-table.el (org-table-eval-formula): Throw an error when
trying to replace a wrong formula specifier.
Thanks to Alejandro Suarez for reporting this.
* org-table.el (org-table-clean-before-export): The regexes match
spaces in addition to the special characters that might be used in
the first column as special marking characters. Remove the space
from the character class.
In addition, the `special' variable included a backslash which
afaict does nothing: delete it.
The function itself takes an optional parameter which is not used by
any of the callers: get rid of it. Getting rid of it allows a small
simplification of the code.
The bug was found by Thorsten Grothe:
http://thread.gmane.org/gmane.emacs.orgmode/88634
org-table.el (org-table-align): Use `org-string-width'.
This aims at better guessing how wide a narrowed table column should
actually be. This won't work perfectly with variable-width scripts,
as it still only narrows in full-column increments, but it's better
than before.
org-table.el (org-table-justify-field-maybe): Use
`org-string-width' instead of `length' to calculate the visual
width of table cells.
This is useful for e.g. double-width charsets.
* org-table.el (org-table-copy-increment): Use a number as a
way to force a fixed increment value.
(org-table-copy-down): Increment by the difference between the
current field and the field in the row above. This is the
default behavior. To go back to the previous behavior (to
always increment by 1 unit), set `org-table-copy-increment'
to 1.
Thanks to Michael Brand for suggesting this.
* org-clock.el (org-clocktable-write-default): New parameter
":sort" to sort a column by a sorting type. E.g., a value of
:sort (1 . ?a) will sort the first column alphabetically. The
sorting line is the third one, table-wise, which is usually
the first line that contains user data.
* org.texi (The clock table): Document the new :sort
parameter.
* org.el (org-do-sort): Recognize [H]H:MM strings as time
values and allow sort-by-time to process them.
* org-table.el (org-table-sort-lines): Mention that sorting by
time also recognize [H]H:MM time values.
* org-compat.el (org-move-to-column): Always ignore invisible
text in agenda buffer, and when there is both a bracket link
and '(org-link) as a member of `buffer-invisibility-spec'.
Add a docstring.
* org.el (org-align-tags-here): Add docstring and remove
useless arguments when calling `org-move-to-column'.
* org-table.el (org-table-copy-down)
(org-table-find-dataline, org-table-move-row)
(org-table-insert-hline, org-table-kill-row):
* org-agenda.el (org-agenda-next-item)
(org-agenda-previous-item, org-agenda-todo)
(org-agenda-priority, org-agenda-show-new-time)
(org-agenda-clock-in, org-agenda-clock-out): Remove useless
arguments when calling `org-move-to-column'.
This fixes the issue about S-RET not placing the cursor in the right
table field when M-x org-toggle-link-display RET removed '(org-link)
from `buffer-invisibility-spec' and some other discrepancies (like
S-M-<up> not restoring point correctly when there is a bracket link
before point, or M-x org-clock-display RET not aligning overlays
correctly, etc.
Thanks to Matt Lundin and Michael Brand for tracking issues
about this.
* org-table.el (org-table-copy-down)
(org-table-find-dataline, org-table-move-row)
(org-table-insert-hline, org-table-kill-row): Use
`org-move-to-column' with the IGNORE-INVISIBLE arg set to `t',
so that abbreviated rows don't interfer with setting the
cursor back at the correct position.
Thanks to Jason Lewis for reporting one of these bugs.
* lisp/org-table.el (org-table-remote-reference-indirection): Change
the local variable START to a value that will be still valid after
`replace-match'.
* lisp/org-table.el (org-table-remote-reference-indirection): Use the
optional arg START of `string-match' to improve performance and to
avoid endless loop on user error.
* doc/org.texi (References): Add description for indirection of
NAME-OR-ID.
* lisp/org-table.el (org-table-eval-formula): Make use of
`org-table-remote-reference-indirection'.
(org-table-remote-reference-indirection): New function.
* testing/lisp/test-org-table.el
(test-org-table/remote-reference-indirect): Change to use remote
reference indirection.
* org-macs.el (org-autoload): Delete.
* org-docview.el ("docview"): Fix declarations and require
doc-view directly.
* org-id.el (org-id-copy)
(org-id-get-with-outline-path-completion)
(org-id-get-with-outline-drilling, org-id-new):
* org-colview.el:
(org-colview-initial-truncate-line-value)
(org-columns-open-link, org-string-to-number):
* org-clock.el:
(org-clock-put-overlay, org-count-quarter, org-clock-loaded):
* org-archive.el (org-get-local-archive-location):
* org-agenda.el (org-agenda-todo-custom-ignore-p):
Autoload.
Those functions were autoloaded from within calls to `org-autoload'
in org.el, we now autoload them from where they live.
* lisp/org-table.el (org-table-convert-region): Interpret string SEPARATOR
as regular expression. Triple `C-u' prefix arg will read a regexp
from the user.
* doc/org.texi: Document that `C-c |' can take a regexp as a separator.
Patch modified from a proposal by Francois.
* org-table.el (org-table-sum): Fix rounding error when
summing times.
Thanks to Paul Stansell for reporting this and to Nick Dokos for
providing the fix.
See http://mid.gmane.org/87ppv2atvf.fsf%40gmail.com for the
discussion of this bug.
* lisp/ob-core.el (org-babel-get-rownames),
lisp/org-table.el (org-table-transpose-table-at-point): Replace the
inadvertent use of mapcar* (from cl) by plain mapcar and direct cons
manipulation.
The error was not caught at compilation time since both source files
require cl during compilation for using cl macros. These were the
only uses of mapcar* in Org, but I didn't check for other cl
_functions_ (as opposed to macros, which would need to be checked if
their implementation uses cl functions).
* lisp/org.el (org-table-clean-did-remove-column),
lisp/org-table.el (org-table-clean-did-remove-column): Move defvar,
this dynamic variable is only used in org-table.
* lisp/org-table.el (org-table-colgroup-info): Remove unused defvar
for `org-table-colgroup-info'.
(org-table-clean-before-export): Let-bind regular expression strings
and remove unused matching group. Use
`org-table-clean-did-remove-column' in cond statement rather than
branching via if to avoid code duplication. Remove the code
associated with the removed `org-table-colgroup-info'.
(orgtbl-export): Remove unused internal function.
* lisp/org-table.el (org-table-get-remote-range): Extend regexp to
match "#+NAME: table" additionally to "#+TBLNAME: table".
* testing/lisp/test-org-table.el: Add test.
* testing/org-test.el (org-test-table-target-expect): Allow several
tables to support testing remote references in the last table.
* org-table.el (org-table-copy-down): Don't move cursor when
getting the field.
This prevents the point from moving when inadvertently calling
S-RET outside of a table.
(org-table-make-reference): A range with only empty fields should lead
to length 0.
* testing/lisp/test-org-table.el: Adapt expected for several
ert-deftest.
The range len bugs may lead to wrong calculations for range references
with empty fields when the range len is relevant. Affects typically
Calc vmean on simple range and without format specifier EN. Also
Lisp with e. g. `length' on simple range or with L.
It is worth a small compatibility change: For a range with only empty
fields it is now possible and necessary to choose different behaviors
of vmean by adding the format specifiers E and/or N.
This is a follow-up of commit
764315b3fc.
* org-table.el (org-calc-current-TBLFM): Ensure to remove the
currently inserted TBLFM line, when calling `org-table-recalculate'
returns an error and the processing stops.
* testing/lisp/test-org-table.el: Add test.
When you hit =C-c C-c= at the line of "#+TBLFM: $2=$1*2::$2=$1**2" in
| 1 | |
| 2 | |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2::$2=$1**2
you got:
| 1 | |
| 2 | |
#+TBLFM: $2=$1*2::$2=$1**2
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2::$2=$1**2
with the error message of:
user-error: Double definition `$2=' in TBLFM line, please fix by hand
In this case, you expected:
| 1 | |
| 2 | |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2::$2=$1**2
* org-table.el (org-calc-current-TBLFM): New function to
re-calculate the table by applying the #+TBLFM in the line
where the point is.
* org.el (org-ctrl-c-ctrl-c): Call `org-calc-current-TBLFM' when
point is in the #+TBLFM line.
* testing/lisp/test-org-table.el: Add test.
* lisp/org-table.el (org-table-eval-formula): Work-around for
calc-eval regression.
Calc-eval can no longer be called without initializing the
*Calculator* buffer first.
* org-table.el (orgtbl-to-generic): New parameter `backend' to
export cells content using a specific backend.
(orgtbl-to-latex, orgtbl-to-texinfo): Export cells to LaTeX
and Texinfo before sending the table.
Thanks to Luca Sabbatini for reporting a problem that led to this change.
* org.el (org-set-regexps-and-options): Use
`org-table-set-constants'.
* org-table.el (org-table-set-constants): New function.
(orgtbl-ctrl-c-ctrl-c): Use it.
Thanks to Oliver Večerník for reporting problems here.
* lisp/org-table.el (org-table-eval-formula): The condition-case to
check for must be "error", not "user-error".
This fixes these test failures:
4 unexpected results:
FAILED test-org-table/references/format-specifier-E
FAILED test-org-table/references/format-specifier-EL
FAILED test-org-table/references/format-specifier-L
FAILED test-org-table/references/format-specifier-none
Reported in:
http://permalink.gmane.org/gmane.emacs.orgmode/67450http://permalink.gmane.org/gmane.emacs.orgmode/67503
* org.el (org-move-subtree-down, org-forward-element)
(org-backward-element):
* org-table.el (org-table-previous-field)
(org-table-move-column, org-table-move-row):
* org-list.el (org-move-item-down, org-move-item-up)
(org-cycle-item-indentation): Use `user-error' when moving or
modifying the element at point is not possible.
* org-table.el (org-table-align): Only set the window start
when table alignment is performed in the selected window.
Thanks to Michael Brand for reporting this.
When opening an .org file from another .org file, org-mode
is initialized in the second one while the window is not yet
selected. So, functions run during org-mode's initialization
need to check if the org-mode window is the selected one before
manipulating the "current window".
* contrib/lisp/org-mime.el (org-mime-htmlize, org-mime-compose): Use
new exporter.
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use new
exporter.
* lisp/ob-latex.el (org-babel-execute:latex): Use new exporter.
* lisp/ob-org.el (org-babel-execute:org): Use new exporter.
* lisp/org-agenda.el (org-agenda-menu, org-agenda-write): Use new
iCalendar export back-end.
* lisp/org-table.el (org-table-export, orgtbl-export): Remove
dependency on `org-exp' library.
(org-table-clean-before-export): New function.
(org-table-colgroup-info): New variable.
(orgtbl-to-html): Use to new HTML export back-end.
* lisp/org.el (org-modules): Remove modules relative to obsolete
export framework and add those relative to the new one.
(org-create-formula-image-with-dvipng, org-format-latex
org-create-formula-image-with-imagemagick): Use new exporter.
(org-indent-line): INCLUDE keywords are indented like regular
keywords.
(org-mode-map): Bind C-c C-e to new export dispatcher.
(org-menu): Install new exporter in menu.
* doc/org.texi (Formula syntax for Calc): Add explanation and example
for empty field.
* lisp/org-table.el (org-table-eval-formula): Use `keep-empty' in more
places.
(org-table-make-reference): Use nan (not a number) for empty fields in
Calc formulas.
* testing/lisp/test-org-table.el: Adapt expected for several
ert-deftest.
(test-org-table/empty-field): New examples dealing with empty fields.
(test-org-table/copy-field): New ert-deftest with examples dealing with
empty fields.
This makes it possible to write spreadsheet Calc formulas that check
for empty fields: To sum the first two columns unless one or both
empty:
$3 = if("$1" = "nan" || "$2" = "nan", string(""), $1 + $2); E
* lisp/org-table.el (org-table-eval-formula): Keep empty fields during
preprocessing.
(org-table-make-reference): A range with only empty fields should not
always return 0 but also empty string, consistent with field reference
of an empty field. Use future design for nan but replicate current
behavior.
* testing/lisp/test-org-table.el: Adapt expected for several
ert-deftest.
The range len bugs may lead to wrong calculations for range references
with empty fields when the range len is relevant. Affects typically
Calc vmean on simple range and without format specifier EN. Also
Lisp with e. g. `length' on simple range or with L.
* org-table.el (org-table-fedit-lisp-indent)
(orgtbl-self-insert-command): Use `org-delete-backward-char'
instead of `backward-delete-char'.
* org.el (org-delete-backward-char, org-delete-char): Save
match data.
* org.el (org-delete-backward-char, org-delete-char): Save
match data (`delete-backward-char' and `delete-char' don't.)
(org-enable-table-editor, org-insert-heading)
(org-remove-timestamp-with-keyword, org-self-insert-command):
Use `delete-backward-char' instead of `backward-delete-char'.
* org-table.el (org-table-fedit-lisp-indent)
(orgtbl-self-insert-command): Ditto.
* org-latex.el (org-export-latex-subcontent): Ditto.
* org-clock.el (org-clocktable-write-default): Ditto.
* org-ascii.el (org-export-ascii-preprocess): Ditto.
Thanks to Vegard Vesterheim for raising this issue and proposing a patch,
and to Carsten for pointing at the root of the problem.
* org-table.el (org-table-eval-formula): Handle localized
time-stamps by internally converting them to english during
formulas evaluation.
Thanks to Viktor Rosenfeld for suggesting this.
* lisp/org-table.el: added macro org-define-lookup-function and the
calls to this macro that generate the lookup functions
org-lookup-first, org-lookup-last and org-lookup-all
* doc/org.texi: documented lookup functions
* org-table.el (org-table-eval-formula): Convert time-stamps
to inactive time-stamp so that Calc can handle them correctly.
Thanks to Daniel E. Doherty for reporting this.
* org-table.el (org-table-number-regexp): Allow the user to
set it to a new regexp, which allows commas as decimal mark.
The default is to not use this setting, but the one before
commit 7ff8c1, which has ben reverted.
See the discussion here:
http://thread.gmane.org/gmane.emacs.orgmode/59389
* org-table.el (org-table-convert-refs-to-rc): Fix bug when
converting remote table references.
Thanks to Jose E. Marchesi who provided a preliminary patch for this.
* org-table.el (orgtbl-radio-table-templates): Add a template
for org-mode.
(orgtbl-to-orgtbl): Complete and align the table created with
orgtbl-to-orgtbl, in case the user use the function for radio
tables.
(orgtbl-to-table.el): New function to export a table to
another one using the table.el format.
(orgtbl-to-unicode): New function to export a table using
unicode characters.
* org-table.el (org-table-time-string-to-seconds): Return the
empty string if provided.
(org-table-eval-formula): When assigning a duration string,
handle it correctly -- i.e. don't make any computation on it,
except the one to insert it using the correct duration format.
Thanks to Sébastien Vauban for spotting this.
* org-table.el (org-table-store-formulas): Fix typo.
(org-table-maybe-eval-formula): Fix the regexp to only match
formulas, which never end with the `=' character. If the
field only contain this character, don't eval either.
Thanks to Thomas S. Dye for reporting this.
* org-table.el (org-tbl-calc-modes): Rename from
`org-table-modes'.
(org-set-calc-mode, org-table-eval-formula): Use it.
Thanks to Mikkel Kristiansen for reporting this and
to Nick Dokos for tracking down the bug and proposing
a fix.
* org-table.el (orgtbl-to-generic): Add check for :skipheadrule.
When present, the :hline following the head will be skipped. This is
necessary to avoid doubling of horizontal rules in LaTeX longtable
environments and consequent width problems.
* org-latex.el (org-export-latex-tables-tstart)
(org-export-latex-tables-hline)
(org-export-latex-tables-tend): New options.
(org-export-latex-tables): Use the new options.
* org-table.el (orgtbl-send-table): Escape special characters.
Introduce a new parameter :no-escape to prevent escaping.
* org.texi (Radio tables): Document the :no-escape parameter.
Thanks to Alexander Willand for raising this issue.
* org-table.el (org-table-get-range): Fix bug: make sure
references to $0 are correctly handled.
Thanks to Nick Dokos for the suggestion.
This fixes the computation of values in this table:
| Record | Slope | ConfLower | ConfUpper |
|----------+--------------+--------------+--------------|
| GISTEMP | 0.0173837600 | 0.0133209130 | 0.0214466060 |
| HadCrut3 | 0.0158602890 | 0.0118664610 | 0.0198541180 |
See this message/thread:
http://article.gmane.org/gmane.emacs.orgmode/54341
* org-table.el (org-table-recalculate-buffer-tables)
(org-table-iterate-buffer-tables): Add autoload cookie.
Thanks to Sébastien Vauban who suggested adding an autoload
cookie for `org-table-iterate-buffer-tables'.
* org-table.el (orgtbl-self-insert-command): Use
`backward-delete-char' instead of `delete-backward-char' as
this last command gets caught by the compiler which says to
not use it in programs. `backward-delete-char' is just an
alias for `delete-backward-char' which is internally remapped
to `org-delete-backward-char' for optimization purpose.
* org.el (org-self-insert-command): Ditto.