* 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.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.
This commit also bumps the version number to 7.8.06.
The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.
This commit reverts back the maint branch to its state before
merging the master branch. From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
Format for fields which contain the result of a formula.
For example, using \"~%s~\" will display the result within tilde
characters. Beware that modifying the display can prevent the
field from being used in another formula.
Based on an idea of Dov Grobgeld.
* lisp/org-table.el (org-table-formula-handle-first/last-rc): Do not
expand pointers to first/last row/column that are inside a call
to `remote'.
(org-table-get-remote-range): Expand pointers to first/last
row/column.
Wu Feng writes:
> Hello,
>
> First, please check below simple example, I defined two tables (T1 and
> T2). In table-2, I remotely refer to the @>$1 (last row, column 1) and
> $LR2 (last row, column 2) of T1.
>
> #+TBLNAME: T1
> | 11 | 12 |
> | 21 | 22 |
> | 31 | 32 |
>
> #+TBLNAME: T2
> | xxx | xxx | xxx | xxx |
> | # | 21 | 32 | |
> #+TBLFM: @>$3=remote(T1,$LR2)::@>$2=remote(T1,@>$1)
>
> Obviously, the expected results are:
>
> - remote(T1,@>$1) is replaced by 31
> - remote(T1,$LR2) is replaced by 32
>
> But I got 21 for remote(T1,@>$1). The $LR version works perfectly
> (though the manual says $LR is out-dated)
>
> Below are debug info when evaluating remote(T1,@>$1). Looks like @> in
> the remote reference is mapped to the last row of the current table, not
> of the remote table.
>
> Substitution history of formula
> Orig: remote(T1,@2$1)
> $xyz-> remote(T1,@2$1)
> @r$c-> (21)
> $1-> (21)
> Result: 21
> Format: NONE
> Final: 21
>
> Emacs : GNU Emacs 23.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.6)
> of 2011-09-13 on shirley
> Package: Org-mode version 7.7
Additionally, replace one
(or (org-mode-p) (derived-mode-p 'org-mode))
with
(derived-mode-p 'org-mode)
cause that is reflexive anyway (returns true, if the current mode is
org-mode).
Delete one check testing for org-mode or org derived mode
* lisp/org-table.el (org-table-fix-formulas): Throw error when changing
formula leads to an invalid formula.
This fix catches at least one case, the one described by Nicolas:
> | 1 | 2 | 3 |
> | 1 | 2 | 3 |
> #+TBLFM: @2$1..@2$3=@1
> If I remove the second column (M-S-Left), the formula is correctly
> updated. But when I remove the last column, the formula gets partly
> deleted and becomes:
>
> #+TBLFM: @2$1..
>
* org-table.el (org-table-get-specials): Allow the use of the
underscore character in column names.
(org-table-get-specials): Allow the use of the underscore
character in field names.
Thanks to András Major for bringing this up and to Nick Dokos
for a suggested fix.
Also remove blank lines before the ";;; org*el ends here" declarations.
Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.
Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
* org-table.el (org-table-eval-formula): Fix missing variable
in let construct.
(org-table-time-string-to-seconds): Fix missing variable in
let construct.
Thanks to John Wiegley for pointing at this.
This allows to display the output of duration computations
as a fraction of days, hours, minutes or seconds.
Thanks to Daniel E. Doherty for bringing up this need.
* org-table.el (org-table-duration-custom-format): New
defcustom to select output format of durations computations.
(org-table-time-seconds-to-string): Use the new variable.
(org-table-eval-formula): Allow `t' as a flag, on top of `T'.
`t' will use the custom output format defined in
`org-table-duration-custom-format.
* org-table.el (org-table-eval-formula): Fix bug when a
formula "range" is just one cell.
(org-table-time-string-to-seconds): don't check whether
we manipulate a string.
* org-table.el (org-table-time-string-to-seconds): match
either HH:MM:SS or HH:MM (instead of MM:SS).
Thanks to Gustav Wikström for suggesting this change.
* org-table.el (org-table-eval-formula): Throw an error when
trying to replace complex range with invalid references.
Thanks to Ken Williams for pointing this out.
* install/git/org-mode/lisp/org-table.el
(org-table-time-seconds-to-string): use `org-format-seconds'
instead of `format-seconds'.
* install/git/org-mode/lisp/org-macs.el (org-format-seconds):
handle case where `format-seconds' does not exist.
* install/git/org-mode/lisp/org-table.el
(org-table-time-string-to-seconds)
(org-table-time-seconds-to-string): New functions.
(org-table-eval-formula): Implement the "T" (time) flag for
computing durations.
* lisp/ob.el (org-babel-sha1-hash): Adding optional argument KIND to
all org-called-interactively-p function invocations.
* lisp/org-agenda.el (org-agenda-redo): Adding optional argument KIND to
all org-called-interactively-p function invocations.
(org-agenda-show-1): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-agenda-set-tags): Adding optional argument KIND to all
org-called-interactively-p function invocations.
* lisp/org-ascii.el (org-export-as-latin1): Adding optional argument
KIND to all org-called-interactively-p function invocations.
(org-export-as-latin1-to-buffer): Adding optional argument KIND to
all org-called-interactively-p function invocations.
(org-export-as-utf8-to-buffer): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-export-region-as-ascii): Adding optional argument KIND to all
org-called-interactively-p function invocations.
* lisp/org-docbook.el (org-export-region-as-docbook): Adding optional
argument KIND to all org-called-interactively-p function
invocations.
* lisp/org-html.el (org-export-region-as-html): Adding optional
argument KIND to all org-called-interactively-p function
invocations.
* lisp/org-latex.el (org-export-region-as-latex): Adding optional
argument KIND to all org-called-interactively-p function
invocations.
* lisp/org-table.el (org-table-blank-field): Adding optional argument
KIND to all org-called-interactively-p function invocations.
(org-table-current-column): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-table-current-dline): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-table-sort-lines): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-table-sum): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-table-rotate-recalc-marks): Adding optional argument KIND to
all org-called-interactively-p function invocations.
(org-table-eval-formula): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(orgtbl-send-table): Adding optional argument KIND to all
org-called-interactively-p function invocations.
* lisp/org.el (org-mode): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-copy-subtree): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-paste-subtree): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-store-link): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-todo): Adding optional argument KIND to all
org-called-interactively-p function invocations.
(org-occur): Adding optional argument KIND to all
org-called-interactively-p function invocations.
Interactive-p is an obsolete function as of Emacs 23.2.
`org-called-interactively-p' takes care of the current (x)Emacs
version and use either `interactive-p' (for XEmacs and Emacs<23.2)
or `called-interactively-p'.
* lisp/org-agenda.el (org-agenda-redo): Replacing call to now-defunct
function `interactive-p'.
(org-agenda-show-1): Replacing call to now-defunct function
`interactive-p'.
(org-agenda-set-tags): Replacing call to now-defunct function `interactive-p'.
* lisp/org-ascii.el: Replacing call to now-defunct function
`interactive-p'.
(org-export-as-latin1): Replacing call to now-defunct function
`interactive-p'.
(org-export-as-latin1-to-buffer): Replacing call to now-defunct
function `interactive-p'.
(org-export-as-utf8): Replacing call to now-defunct function
`interactive-p'.
(org-export-as-utf8-to-buffer): Replacing call to now-defunct function
`interactive-p'.
(org-export-region-as-ascii): Replacing call to now-defunct function
`interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-docbook.el: Replacing call to now-defunct function
`interactive-p'.
(org-export-region-as-docbook): Replacing call to now-defunct function
`interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-html.el: Replacing call to now-defunct function
`interactive-p'.
(org-export-region-as-html): Replacing call to now-defunct function
`interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-latex.el: Replacing call to now-defunct function
`interactive-p'.
(org-export-region-as-latex): Replacing call to now-defunct function
`interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-macs.el: Replacing call to now-defunct function
`interactive-p'.
(org-called-interactively-p): Replacing call to now-defunct function
`interactive-p'.Replacing call to now-defunct function `interactive-p'.
* lisp/org-table.el: Replacing call to now-defunct function
`interactive-p'.
(org-table-blank-field): Replacing call to now-defunct function
`interactive-p'.
(org-table-current-column): Replacing call to now-defunct function
`interactive-p'.Replacing call to now-defunct function
`interactive-p'.
(org-table-current-dline): Replacing call to now-defunct function
`interactive-p'.Replacing call to now-defunct function
`interactive-p'.
(org-table-sort-lines): Replacing call to now-defunct function
`interactive-p'.
(org-table-sum): Replacing call to now-defunct function
`interactive-p'.
(org-table-rotate-recalc-marks): Replacing call to now-defunct
function `interactive-p'.
(org-table-eval-formula): Replacing call to now-defunct function
`interactive-p'.
(orgtbl-send-table): Replacing call to now-defunct function `interactive-p'.
* lisp/org.el: Replacing call to now-defunct function `interactive-p'.
(org-mode): Replacing call to now-defunct function `interactive-p'.
(org-copy-subtree): Replacing call to now-defunct function
`interactive-p'.
(org-paste-subtree): Replacing call to now-defunct function
`interactive-p'.
(org-store-link): Replacing call to now-defunct function
`interactive-p'.
(org-todo): Replacing call to now-defunct function `interactive-p'.
(org-occur): Replacing call to now-defunct function `interactive-p'.
* org.el (org-self-insert-command): Use `delete-char' instead of
`delete-backward-char'.
* org-table.el (orgtbl-self-insert-command): Dto.
According to the doc string `delete-backward-char' "is meant for
interactive use only; from Lisp, better use `delete-char' with a
negated argument."
* doc/org.texi (Built-in table editor): Document the table field follow mode.
* lisp/org-table.el (org-table-exit-follow-field-mode-when-leaving-table):
New option.
(org-table-check-inside-data-field): New optional argument `noerror'.
When set, the function will only return nil instead of throwing an
error.
(org-table-edit-field): Interpret double prefix argument, and improve
the properties of the editing window.
(org-table-follow-field-mode): New minor mode.
(org-table-follow-fields-with-editor): New function.
The main purpose of this functionality is to make working with table
with long fields simpler, by always showing the full content of the
current field. This functionality is based on the following
mailing list thread
http://thread.gmane.org/gmane.emacs.orgmode/41584
and contains ideas by Jonny, Juan Pechiar, and Michael Brand.
* lisp/org-table.el (org-table-cleanup-narrow-column-properties): Use
point-min rather than 1 when moving in the buffer.
Signed-off-by: Julien Danjou <julien@danjou.info>
* org-table.el (org-table-fix-formulas-confirm): new custom
variable.
(org-table-insert-column, org-table-delete-column)
(org-table-move-column, org-table-move-row)
(org-table-insert-row, org-table-kill-row): Use it.
* lisp/org-table.el (org-table-eval-formula): Treat relative column refs.
I cannot believe this did not work and nobody complained about this.
$-1 is supposed to refer to the value in the column to the left. Now
this does work.
* lisp/org-table.el (org-table-fedit-finish): Read more general LHS of formulas.
(org-table-formula-handle-@L): New function to hanle @L references.
(org-table-current-ncol): New variable.
(org-table-line-to-dline): New function.
(org-table-get-stored-formulas): Accept range formulas as matches.
(org-table-get-specials): Compute and store the number of columns.
(org-table-get-range): New optional argument CORNERS-ONLY, to retrieve
only the region marked by the range, not the content.
(org-table-recalculate): Call `org-table-expand-lhs-ranges' to expand
range targets. Also check for duplicate access to fields.
(org-table-expand-lhs-ranges): New funktion.
(org-table-get-remote-range): Bind `org-table-current-ncol' to protect
the caller's value.
(org-table-edit-formulas): Support highlighting of range targets.
(org-table-field-info): Handle renge formulas.
* doc/org.texi (Field and range formulas): Renamed from "Field formulas".
Document the use of range operators as targets.
(References): Document the new @L reference.
* lisp/org-table.el (orgtbl-after-send-table-hook): New hook.
(orgtbl-ctrl-c-ctrl-c): Run `orgtbl-after-send-table-hook' when a
table was sent.
(orgtbl-send-table): Return the number of sent tables, or nil if no
sending has happened.
Patch by Seweryn Kokot. TINYCHANGE
* doc/org.texi: Document the <c> cookie.
* lisp/org-exp.el (org-store-forced-table-alignment):
(org-export-remove-special-table-lines): Allow the "c" cookie for
table alignment.
* lisp/org-html.el (org-export-table-header-tags):
(org-export-table-data-tags): Add another %s format for the alignment.
(org-export-html-table-align-individual-fields): New option.
(org-format-org-table-html): Implement field-by-field alignment and
support centering.
(org-format-table-table-html): Make sure the new table tag formats
don't break this function.
* lisp/org-table.el (org-table-cookie-line-p):
(org-table-align): Allow for the <c> cookie.
* lisp/org.el (org-set-font-lock-defaults): Allow for the <c> cookie.