Commit Graph

582 Commits

Author SHA1 Message Date
Aaron Ecay 07e16c2fc5 Use setq-local and defvar-local.
* lisp/org-macs.el (org-set-local): Remove.  All callers changed.
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-macro.el:
* lisp/org-mouse.el:
* lisp/org-table.el:
* lisp/org.el: Use defvar-local.
* lisp/org-agenda.el:
* lisp/org-capture.el:
* lisp/org-crypt.el:
* lisp/org-ctags.el:
* lisp/org-plot.el:
* lisp/org.el:
* lisp/ox-odt.el:
* lisp/ox.el: Use setq-local instead of set + make-local-variable.

Changes in contrib:

* contrib/lisp/org-colview-xemacs.el (org-colview-xemacs-set-local): New
macro. Adjust old callers of `org-set-local'.
2015-11-05 16:47:38 +00:00
Nicolas Goaziou f0bf77e82a Activate lexical binding in some libraries
* lisp/ob-C.el (org-babel-prep-session:C):
(org-babel-load-session:C):
* lisp/ob-J.el:
(org-babel-expand-body:J):
(org-babel-execute:J):
* lisp/ob-R.el:
(org-babel-expand-body:R):
* lisp/ob-abc.el:
(org-babel-execute:abc):
(org-babel-prep-session:abc):
* lisp/ob-asymptote.el:
(org-babel-execute:asymptote):
(org-babel-prep-session:asymptote):
* lisp/ob-awk.el:
(org-babel-expand-body:awk):
* lisp/ob-calc.el:
(org-babel-expand-body:calc):
* lisp/ob-clojure.el:
* lisp/ob-comint.el:
(org-babel-comint-in-buffer):
(org-babel-comint-with-output):
(org-babel-comint-eval-invisibly-and-wait-for-file):
* lisp/ob-coq.el:
* lisp/ob-css.el:
(org-babel-execute:css):
(org-babel-prep-session:css):
* lisp/ob-ditaa.el:
(org-babel-execute:ditaa):
(org-babel-prep-session:ditaa):
* lisp/ob-dot.el:
(org-babel-execute:dot):
(org-babel-prep-session:dot):
* lisp/ob-ebnf.el:
* lisp/ob-emacs-lisp.el:
* lisp/ob-eval.el:
* lisp/ob-forth.el:
* lisp/ob-fortran.el:
(org-babel-execute:fortran):
(org-babel-prep-session:fortran):
(org-babel-load-session:fortran):
* lisp/ob-gnuplot.el:
(org-babel-expand-body:gnuplot):
(org-babel-prep-session:gnuplot):
(org-babel-gnuplot-initiate-session):
* lisp/ob-groovy.el:
(org-babel-prep-session:groovy):
(org-babel-groovy-initiate-session):
* lisp/ob-haskell.el:
(org-babel-haskell-initiate-session):
* lisp/ob-io.el:
(org-babel-prep-session:io):
(org-babel-io-initiate-session):
* lisp/ob-java.el:
(org-babel-execute:java):
* lisp/ob-js.el:
* lisp/ob-keys.el:
* lisp/ob-latex.el:
(org-babel-prep-session:latex):
* lisp/ob-ledger.el:
(org-babel-execute:ledger):
(org-babel-prep-session:ledger):
* lisp/ob-lilypond.el:
(org-babel-lilypond-commands):
(org-babel-lilypond-process-basic):
(org-babel-prep-session:lilypond):
(org-babel-lilypond-parse-line-num):
* lisp/ob-lisp.el:
* lisp/ob-makefile.el:
(org-babel-execute:makefile):
(org-babel-prep-session:makefile):
* lisp/ob-matlab.el:
* lisp/ob-maxima.el:
(org-babel-prep-session:maxima):
* lisp/ob-mscgen.el:
(org-babel-prep-session:mscgen):
* lisp/ob-ocaml.el:
(org-babel-execute:ocaml):
(org-babel-prep-session:ocaml):
* lisp/ob-octave.el:
(org-babel-execute:octave):
(org-babel-octave-initiate-session):
* lisp/ob-org.el:
(org-babel-prep-session:org):
* lisp/ob-perl.el:
(org-babel-prep-session:perl):
(org-babel-perl--var-to-perl):
(org-babel-perl-initiate-session):
* lisp/ob-picolisp.el:
(org-babel-expand-body:picolisp):
(org-babel-execute:picolisp):
* lisp/ob-plantuml.el:
(org-babel-execute:plantuml):
(org-babel-prep-session:plantuml):
* lisp/ob-processing.el:
(org-babel-prep-session:processing):
* lisp/ob-python.el:
(org-babel-python-initiate-session):
* lisp/ob-ref.el:
(org-babel-ref-resolve):
* lisp/ob-ruby.el:
(org-babel-ruby-initiate-session):
* lisp/ob-sass.el:
(org-babel-execute:sass):
(org-babel-prep-session:sass):
* lisp/ob-scala.el:
(org-babel-execute:scala):
(org-babel-prep-session:scala):
(org-babel-scala-initiate-session):
* lisp/ob-scheme.el:
* lisp/ob-screen.el:
(org-babel-prep-session:screen):
(org-babel-screen-session-write-temp-file):
(org-babel-screen-test):
* lisp/ob.el:
* lisp/org-colview.el:
(org-columns-todo):
(org-columns-set-tags-or-toggle):
(org-columns-new):
(org-columns-uncompile-format):
(org-agenda-colview-summarize):
* lisp/org-footnote.el:
(electric-indent-mode):
* lisp/org-indent.el:
(org-indent-refresh-maybe):
* lisp/org-list.el:
* lisp/org-macro.el:
(org-macro--collect-macros):
* lisp/org-src.el:
* lisp/org-table.el:
(sort-fold-case):
(org-table-create):
(org-table-field-info):
(org-table-transpose-table-at-point):
(org-table-remove-rectangle-highlight):
(orgtbl-create-or-convert-from-region):
(org-define-lookup-function):
* lisp/ox-ascii.el:
(org-ascii-format-drawer-function):
(org-ascii--has-caption-p):
(org-ascii-bold):
(org-ascii-center-block):
(org-ascii-clock):
(org-ascii-code):
(org-ascii-dynamic-block):
(org-ascii-entity):
(org-ascii-example-block):
(org-ascii-export-snippet):
(org-ascii-export-block):
(org-ascii-fixed-width):
(org-ascii-footnote-reference):
(org-ascii-horizontal-rule):
(org-ascii-inline-src-block):
(org-ascii-format-inlinetask-default):
(org-ascii-italic):
(org-ascii-keyword):
(org-ascii-latex-environment):
(org-ascii-latex-fragment):
(org-ascii-line-break):
(org-ascii-node-property):
(org-ascii-planning):
(org-ascii-quote-block):
(org-ascii-radio-target):
(org-ascii-special-block):
(org-ascii-src-block):
(org-ascii-statistics-cookie):
(org-ascii-subscript):
(org-ascii-superscript):
(org-ascii-strike-through):
(org-ascii-timestamp):
(org-ascii-underline):
(org-ascii-verbatim):
(org-ascii-verse-block):
(org-ascii-filter-headline-blank-lines):
(org-ascii-filter-paragraph-spacing):
(org-ascii-filter-comment-spacing): Use lexical binding.
2015-10-26 01:56:00 +01:00
Nicolas Goaziou 609e1e28fb Fix "undefined symbol 'org-export-create-backend"
* 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>
2015-10-01 21:55:13 +02:00
Nicolas Goaziou 2e1b93db41 org-table: Fix radio tables
* lisp/org-table.el (orgtbl-to-generic): Strip text properties from
  output.

Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/101425>
2015-09-23 22:58:25 +02:00
Paul Eggert c86a10b0bc Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files
284c470ef752967fcd8bae6a450dc138462b1e49
Paul Eggert
Thu Sep 17 16:09:39 2015 -0700
2015-09-21 18:38:39 -04:00
Kyle Meyer 0839dc4322 Protect remaining apostrophes in docstrings
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.
2015-09-21 18:38:39 -04:00
Kyle Meyer d77a52a502 Backport quote-related commits from Emacs
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
2015-09-21 18:38:18 -04:00
Kyle Meyer 0cf9f17c55 Use substitute-command-keys more
* lisp/ob-core.el (org-confirm-babel-evaluate):
(org-babel-no-eval-on-ctrl-c-ctrl-c):
(org-babel-hash-at-point):
* lisp/org-agenda.el (org-agenda-log-mode-items):
(org-agenda-auto-exclude-function):
(org-search-view):
(org-todo-list):
(org-tags-view):
(org-agenda-log-mode):
(org-agenda-show-the-flagging-note):
* lisp/org-clock.el (org-clock-out-when-done):
* lisp/org-id.el (org-id-link-to-org-use-id):
* lisp/org-table.el (org-table-allow-automatic-line-recalculation):
(org-table-edit-formulas):
* lisp/org.el (org-support-shift-select):
(org-remove-highlights-with-change):
(org-refile-use-cache):
(org-use-fast-todo-selection):
(org-time-stamp-rounding-minutes):
(org-agenda-text-search-extra-files):
(org-cycle):
(org-ctrl-c-ctrl-c): Use substitute-command-keys.
2015-09-21 18:33:45 -04:00
Nicolas Goaziou 54a65250a8 org-table: Silence byte-compiler 2015-09-19 16:36:26 +02:00
Nicolas Goaziou 6d2ab40719 org-table: Fix radio tables containing macros
* 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>
2015-09-19 13:25:12 +02:00
Nicolas Goaziou 46f3f4c626 org-table: Fix number-or-marker-p error
* lisp/org-table.el (org-table-goto-field): Fix number-or-marker-p
  error.

Initial patch by Rasmus <rasmus@gmx.us>.

Reported-by: Scott Randby <srandby@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99715>
2015-08-09 02:12:47 +02:00
Nicolas Goaziou a70604eb63 org-table: Fix computation with backwards ranges
* 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>
2015-08-03 22:58:39 +02:00
Nicolas Goaziou 8094d01a68 org-table: Simplify `org-table-sort-lines'
* lisp/org-table.el (org-table-sort-lines): Rely on `sort-subr'.
  Refactor code.
(org-table--do-sort): Remove function.

* testing/lisp/test-org-table.el (test-org-table/sort-lines): Fix test.
2015-08-02 18:01:15 +02:00
Nicolas Goaziou 14d07c0e7d org-table: Improve tables' speed in large buffers
* 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).
2015-08-02 18:01:12 +02:00
Nicolas Goaziou 8344f29dac org-table: Speed-up `org-table-{begin,end}'
* 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.
2015-08-02 17:56:13 +02:00
Nicolas Goaziou 84d5986cdf org-table: Fix code comments 2015-08-02 17:56:12 +02:00
Nicolas Goaziou 00170d401f org-table: Remove outdated functions
* 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.
2015-08-02 17:55:55 +02:00
Nicolas Goaziou bf37cd09b1 org-table: Do not trim output of radio tables
* 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>
2015-07-23 00:34:02 +02:00
Nicolas Goaziou 120dcd1d13 org-table: Fix table alignment
* lisp/org-table.el (org-table-align): Refactor function fix wrong
  alignment bug.
* lisp/org-compat.el (org-format-transports-properties-p): Remove
  variable.
* testing/lisp/test-org.el (test-org/fill-paragraph): Fix test

Reported-by: William Denton <wtd@pobox.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98901>
2015-07-09 17:53:33 +02:00
Rasmus be019c4339 Autoload orgtbl-exp-regexp
* org-table.el (orgtbl-exp-regexp): Add autoload cookie.

Reported-by: Robert Klein <roklein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/98887>
2015-07-07 14:42:31 +02:00
Nicolas Goaziou f03d96572e Silence byte-compiler 2015-06-28 16:50:08 +02:00
Nicolas Goaziou 6d60138260 org-table: Do not modify buffer needlessly when aligning table
* lisp/org-table.el (org-table-align): Compare new table with old one
  before replacing it.  Only replace modified lines.
2015-06-28 16:21:45 +02:00
Nicolas Goaziou 03eb88661b Use parser for `org-at-table-p' and al.
* lisp/org-table.el (org-table-begin):
(org-table-end): Refactor using parser.

* lisp/org.el (org-at-table-p):
(org-at-table.el-p): Refactor using parser.

(org-meta-return): Use `org-at-table-p'.

(org-at-table-hline-p):
(org-table-recognize-table.el): Small refactoring.
2015-06-28 14:51:31 +02:00
Nicolas Goaziou c916ea54f0 org-table: Remove `org-table-relative-ref-may-cross-hline'
* 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.
2015-06-28 10:34:31 +02:00
Nicolas Goaziou 3924989b4f org-table: Fix formulas with relative ranges in current row
* lisp/org-table.el (org-table-eval-formula): Fix formulas with
  relative ranges in current row.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/97727>
2015-06-09 15:03:27 +02:00
Nicolas Goaziou c0dec9a8bc org-table: Fix durations extracted from node properties
* lisp/org-table.el (org-table-formula-substitute-names): Convert
  durations when needed.  Refactor code.

* testing/lisp/test-org-table.el (test-org-table/duration): New test.

Reported-by: Daniele Pizzolli <dan@toel.it>
<http://permalink.gmane.org/gmane.emacs.orgmode/97252>
2015-05-11 01:20:37 +02:00
Nicolas Goaziou 6ac8db9dba Fix TBLFM line handling
* 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>
2015-05-08 10:46:07 +02:00
Nicolas Goaziou cff54cd127 org-table: `org-table-end' does not return a marker
* 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.
2015-04-06 09:38:21 +02:00
Nicolas Goaziou f6bd2a9cb4 org-table: Fix docstrings
* lisp/org-table.el (org-table-beginning-of-field):
(org-table-end-of-field): Swap docstrings.
2015-03-29 14:14:32 +02:00
Nicolas Goaziou 0d24086657 Update some copyright years 2015-02-16 01:40:07 +01:00
Nicolas Goaziou b5d9f4be4d org-table: Allow accentuated characters in remote table names
* lisp/org-table.el (org-table-eval-formula): Allow a larger set of
  characters in remote name.

Reported-by: flav <flav.justflav@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/75690>
2015-02-01 01:03:45 +01:00
Nicolas Goaziou 53592f4e25 org-table: Fix typo
* lisp/org-table.el (org-table-show-reference): Fix typo.
2015-01-23 00:16:58 +01:00
Aaron Ecay 9f75cea40d Obsolete ‘org-at-regexp-p’.
* lisp/org.el (org-at-regexp-p): Remove, adding an obsolete function
alias.
(org-in-regexp): Tidy docstring.
(org-open-at-point):
(org-between-regexps-p):
* lisp/org-table.el (org-table-fedit-shift-reference):
(org-table-show-reference): Call ‘org-in-regexp’ instead.
2015-01-22 01:52:49 -05:00
Nicolas Goaziou ef523b0bca org-table: Fix `orgtbl-to-unicode'
* lisp/org-table.el (orgtbl-to-unicode): Remove dummy property.
2015-01-07 00:30:34 +01:00
Nicolas Goaziou 70f965535b org-table: Ignore filters and hooks in radio tables
* lisp/org-table.el (orgtbl-to-generic): Ignore user-defined filters
  and hooks.

* testing/lisp/test-org-table.el (test-org-table/to-generic): Add
  tests.

Suggested-by: Aaron Ecay <aaronecay@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93795>
2015-01-05 12:39:26 +01:00
Nicolas Goaziou 44744bba2c org-table: Fix freeze with invalid hline reference
* lisp/org-table.el (org-table-find-row-type): Don't end up on the
  last hline, which doesn't exist, per
  e793158bc8.

Reported-by: Artis Rozentāls <artis.rozentals@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93654>
2014-12-30 22:37:44 +01:00
Nicolas Goaziou 7dc8a1b362 Move `org-do-sort' into "org-table.el"
* 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.
2014-12-21 22:23:11 +01:00
Jon Snader 71b098702c org.el: Implement user-defined table sorting
* 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
2014-12-20 20:36:57 +01:00
Nathaniel Flath 90c047d2ff org-table.el: org-table-recalculate is quieter
* 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
2014-12-14 22:06:25 +01:00
Nathaniel Flath 2945c1e8c5 org-table.el: org-table-recalculate early returns
* lisp/org-table.el (org-table-recalculate): Add early return.

TINYCHANGE
2014-12-14 22:06:20 +01:00
Aaron Ecay b8d790a076 org-table: introduce an upper bound on `org-table-convert-region-max-lines'.
* 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.
2014-12-11 23:51:57 -05:00
Aaron Ecay f12e3d4589 org-table: various small fixes
* lisp/org-table.el (org-table-rewrite-old-row-references): Rename function.
(org-table-eval-formula): Update caller.
(org-table--to-generic-cell): Fix typo in string constant.
(orgtbl-to-orgtbl): Properly respect params argument.
2014-12-10 17:03:38 -05:00
Nicolas Goaziou 61a241f0dc Rewrite setup keywords initialization
* 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.
2014-10-28 14:23:52 +01:00
Nicolas Goaziou 0b74864bfb org-table: Do not look after CONSTANTS in Orgtbl mode
* 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).
2014-10-28 14:23:52 +01:00
Nicolas Goaziou 7f97406542 Bump Emacs version
* lisp/ob-core.el (org-babel-examplize-region):
* lisp/ob-exp.el (org-babel-exp-inline-code-template):
* lisp/org-table.el (org-table-copy-increment):
(org-table-formula-create-columns):
* lisp/org.el (org-agenda-ignore-drawer-properties):
(org-agenda-ignore-properties):
* lisp/ox-ascii.el (org-ascii-list-margin):
* lisp/ox-html.el (org-html-format-headline-function):
(org-html-format-inlinetask-function):
* lisp/ox-latex.el (org-latex-hyperref-template):
(org-latex-custom-id-as-label):
(org-latex-format-inlinetask-function):
(org-latex-known-warnings):
* lisp/ox-odt.el (org-odt-format-headline-function):
(org-odt-format-inlinetask-function):
* lisp/ox-texinfo.el (org-texinfo-format-headline-function): Bump
  Emacs version.
2014-10-24 11:56:09 +02:00
Thierry Banel 0e07eb5665 Ascii and Gnuplot key-bindings
* 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
2014-10-12 11:25:51 +02:00
Dima Kogan 1c1f91811d org-table: Field formulas can now create columns as needed
* 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.
2014-10-12 11:11:57 +02:00
Nicolas Goaziou 39eb7796e8 org-table: Fix :raw parameter in radio tables
* 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
2014-10-11 17:10:05 +02:00
Aaron Ecay 5bb58daa22 org-table: fix docstring
* lisp/org-table.el (org-table-get): Fix docstring.
2014-09-19 14:38:23 -04:00
Achim Gratz 1483df8c99 org-table: for compatibility, use org-file-equal-p
* lisp/org-table.el: Predicate function `file-equal-p' is not
  available in older Emacsen, use compatibility function
  `org-file-equal-p' instead.
2014-09-19 10:05:15 +02:00