• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/textmodes/

Lines Matching +defs:new +defs:table

38 ;; table editor.  Org-mode supports ToDo items, deadlines, time stamps,
138 in table fields. Such tables will look correct only after the first re-align.
198 and just in Org-mode (which will then use its own display table).
205 (defvar org-display-table nil
206 "The display table for org-mode, in case `org-ellipsis' is non-nil.")
402 the new state that was set by the most recent `org-cycle' command. The
440 (defcustom org-blank-before-new-entry '((heading . nil)
442 "Should `org-insert-heading' leave a blank line before new heading/item?
451 "Hook being run after inserting a new heading."
530 a new checkbox with \\[org-insert-todo-heading] or toggle a checkbox
621 (defgroup org-table nil
626 (defcustom org-enable-table-editor 'optimized
627 "Non-nil means, lines starting with \"|\" are handled by the table editor.
630 When equal to the symbol `optimized', the table editor will be optimized to
632 - Automatic overwrite mode in front of whitespace in table fields.
633 This makes the structure of the table stay in tact as long as the edited
635 - Minimize the number of realigns. Normally, the table is aligned each time
647 This variable can be used to turn on and off the table editor during a session,
650 See also the variable `org-table-auto-blank-field'."
651 :group 'org-table
657 (defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
658 "Non-nil means, use the optimized table editor version for `orgtbl-mode'.
659 In the optimized version, the table editor takes over all simple keys that
661 in a way to minimize disturbing the table structure (i.e. in overwrite mode
666 Org-mode. See the variable `org-enable-table-editor' for details. Changing
668 :group 'org-table
671 (defcustom orgtbl-radio-table-templates
692 table, obtained by prompting the user."
693 :group 'org-table
698 (defgroup org-table-settings nil
701 :group 'org-table)
703 (defcustom org-table-default-size "5x2"
705 :group 'org-table-settings
708 (defcustom org-table-number-regexp
710 "Regular expression for recognizing numbers in table columns.
711 If a table column contains mostly numbers, it will be aligned to the
721 :group 'org-table-settings
737 (defcustom org-table-number-fraction 0.5
740 fraction of fields is matched by `org-table-number-fraction',
742 :group 'org-table-settings
745 (defgroup org-table-editing nil
748 :group 'org-table)
750 (defcustom org-table-automatic-realign t
751 "Non-nil means, automatically re-align table when pressing TAB or RETURN.
752 When nil, aligning is only done with \\[org-table-align], or after column
754 :group 'org-table-editing
757 (defcustom org-table-auto-blank-field t
758 "Non-nil means, automatically blank table field when starting to type into it.
761 Only relevant when `org-enable-table-editor' is equal to `optimized'."
762 :group 'org-table-editing
765 (defcustom org-table-tab-jumps-over-hlines t
766 "Non-nil means, tab in the last column of a table with jump over a hline.
768 `org-table-next-field' can either create a new row before that line, or jump
769 over the line. When this option is nil, a new line will be created before
771 :group 'org-table-editing
774 (defcustom org-table-tab-recognizes-table.el t
775 "Non-nil means, TAB will automatically notice a table.el table.
776 When it sees such a table, it moves point into it and - if necessary -
777 calls `table-recognize-table'."
778 :group 'org-table-editing
781 (defgroup org-table-calculation nil
784 :group 'org-table)
786 (defcustom org-table-copy-increment t
787 "Non-nil means, increment when copying current field with \\[org-table-copy-down]."
788 :group 'org-table-calculation
800 "List with Calc mode settings for use in calc-eval for table formulas.
804 :group 'org-table-calculation
807 (defcustom org-table-formula-evaluate-inline t
808 "Non-nil means, TAB and RET evaluate a formula in current table field.
811 string of the command `org-table-eval-formula'. This feature requires the
814 the command \\[org-table-eval-formula]."
815 :group 'org-table-calculation
821 (defcustom org-table-formula-use-constants t
824 by the value given in `org-table-formula-constants', or by a value obtained
826 :group 'org-table-calculation
829 (defcustom org-table-formula-constants nil
830 "Alist with constant names and values, for use in table formulas.
835 (setq org-table-formula-constants '((\"c\" . \"299792458.\")))
838 :group 'org-table-calculation
843 (defcustom org-table-allow-automatic-line-recalculation t
846 :group 'org-table-calculation
877 state in new org-mode buffers. The setting can then be toggled on a
915 :type '(set (const :tag "Double bracket links (new style)" bracket)
1302 "Non-nil means, store new notes at the beginning of a file or entry.
1303 When nil, new notes will be filed to the end of a file or entry."
1352 The new state (a string with a TODO keyword, or nil) is available in the
1405 %s will be replaced by the new TODO state, in double quotes.
1511 moved to the new date."
1603 (defvar org-last-tags-completion-table nil
1604 "The last used completion table for tags.")
1892 dedicated-frame Create one new frame, and re-use it each time.
1893 new-frame Make a new frame each time."
1899 (const :tag "Each time a new frame" new-frame)
2258 "Non-nil means, create a table of contents in exported files.
2263 When nil, no table of contents is made.
2312 "If nil, remove timestamps from the table of contents entries."
2318 If this is the symbol `not-in-toc', tags will be removed from table of
2415 "If non-nil, lines starting with \"|\" define a table.
2428 (defcustom org-export-highlight-first-table-line t
2429 "Non-nil means, highlight the first table line.
2431 In tables created with table.el, this applies to the first table line.
2437 (defcustom org-export-table-remove-special-lines t
2447 "Non-nil means, always export tables created with table.el natively.
2448 Natively means, use the HTML code generator in table.el.
2450 the table does not use row- or column-spanning). This has the
2507 table { border-collapse: collapse; }
2517 for new classes todo, done, title, and deadline. For example, legal values
2580 (defcustom org-export-html-table-tag
2581 "<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">"
2582 "The HTML tag used to start a table.
2583 This must be a <table> tag, but you may change the options like
2957 (defface org-table ;; font-lock-function-name-face
3351 (defvar org-category-table)
3470 ;; We use a before-change function to check if a table might need
3472 (defvar org-table-may-need-update t
3473 "Indicates that a table might need an update.
3475 `org-table-align' sets it back to nil.")
3492 calendar. Tables are easily created with a built-in table editor.
3527 (fboundp 'set-display-table-slot) (boundp 'buffer-display-table))
3528 (unless org-display-table
3529 (setq org-display-table (make-display-table)))
3530 (set-display-table-slot org-display-table
3532 (setq buffer-display-table org-display-table))
3541 (org-set-local 'org-table-may-need-update t)
3572 (org-table-map-tables 'org-table-align)
3907 (1 'org-table))
3950 '("^[ \t]*\\(:.*\\)" (1 'org-table t))
4047 ((org-at-table-p 'any)
4048 ;; Enter the table or move to the next field in the table
4049 (or (org-table-recognize-table.el)
4051 (if arg (org-table-edit-field t)
4052 (org-table-justify-field-maybe)
4053 (call-interactively 'org-table-next-field)))))
4060 ;; We just created the overview - now do table of contents
4070 ;; We just showed the table of contents - now show everything
4189 "Show all headlines in the buffer, like a table of contents.
4279 to the new location, making it and the headline hierarchy above it visible."
4337 "Finish `org-goto' by going to the new location."
4344 "Finish `org-goto' by going to the new location."
4355 "Finish `org-goto' by going to the new location."
4386 requests that a new frame be made for the new buffer, so that the dedicated
4409 ((or (eq org-indirect-buffer-display 'new-frame)
4457 "Insert a new heading or item with same depth at point.
4458 If point is in a plain list and FORCE-HEADING is nil, create a new list item.
4473 (blank (cdr (assq 'heading org-blank-before-new-entry)))
4491 "Insert a new heading with the same level and TODO state as current heading.
4771 The entire subtree is promoted or demoted in order to match a new headline
4772 level. By default, the new level is derived from the visible headings
4820 (new-level (or force-level (max previous-level next-level)))
4822 (= new-level -1)
4823 (= old-level new-level))
4825 (- new-level old-level)))
4849 (message "Pasted at level %d, without shift" new-level)
4857 new-level shift1)))
4897 "Call `org-sort-entries' or `org-table-sort-lines', depending on context."
4899 (if (org-at-table-p)
4900 (org-call-with-arg 'org-table-sort-lines with-case)
4984 (defun org-do-sort (table what &optional with-case sorting-type)
4989 the car of the elements of the table.
5020 table)
5052 "Insert a new item at the current level.
5065 (blank (cdr (assq 'plain-list-item org-blank-before-new-entry)))
5701 ;;; The table editor
5704 ;; Most of the code is for the tables created with the Org-mode table editor.
5705 ;; Sometimes, we talk about tables created and edited with the table.el
5707 ;; table.el-type tables.
5710 "Every change indicates that a table might need an update."
5711 (setq org-table-may-need-update t))
5713 (defconst org-table-line-regexp "^[ \t]*|"
5714 "Detects an org-type table line.")
5715 (defconst org-table-dataline-regexp "^[ \t]*|[^-]"
5716 "Detects an org-type table line.")
5717 (defconst org-table-auto-recalculate-regexp "^[ \t]*| *# *\\(|\\|$\\)"
5718 "Detects a table line marked for automatic recalculation.")
5719 (defconst org-table-recalculate-regexp "^[ \t]*| *[#*] *\\(|\\|$\\)"
5720 "Detects a table line marked for automatic recalculation.")
5721 (defconst org-table-calculate-mark-regexp "^[ \t]*| *[!$^_#*] *\\(|\\|$\\)"
5722 "Detects a table line marked for automatic recalculation.")
5723 (defconst org-table-hline-regexp "^[ \t]*|-"
5724 "Detects an org-type table hline.")
5726 "Detects a table-type table hline.")
5727 (defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)"
5728 "Detects an org-type or table-type table.")
5729 (defconst org-table-border-regexp "^[ \t]*[^| \t]"
5730 "Searching from within a table (any type) this finds the first line
5731 outside the table.")
5732 (defconst org-table-any-border-regexp "^[ \t]*[^|+ \t]"
5733 "Searching from within a table (any type) this finds the first line
5734 outside the table.")
5736 (defvar org-table-last-highlighted-reference nil)
5737 (defvar org-table-formula-history nil)
5739 (defvar org-table-column-names nil
5741 (defvar org-table-column-name-regexp nil
5743 (defvar org-table-local-parameters nil
5745 (defvar org-table-named-field-locations nil
5748 (defvar org-table-current-line-types nil
5750 (defvar org-table-current-begin-line nil
5752 (defvar org-table-dlines nil
5753 "Vector of data line line numbers in the current table.")
5754 (defvar org-table-hlines nil
5755 "Vector of hline line numbers in the current table.")
5757 (defconst org-table-range-regexp
5762 (defconst org-table-range-regexp2
5769 (defun org-table-create-with-table.el ()
5770 "Use the table.el package to insert a new table.
5771 If there is already a table at point, convert between Org-mode tables
5772 and table.el tables."
5774 (require 'table)
5776 ((org-at-table.el-p)
5777 (if (y-or-n-p "Convert table to Org-mode table? ")
5778 (org-table-convert)))
5779 ((org-at-table-p)
5780 (if (y-or-n-p "Convert table to table.el table? ")
5781 (org-table-convert)))
5782 (t (call-interactively 'table-insert))))
5784 (defun org-table-create-or-convert-from-region (arg)
5785 "Convert region to table, or create an empty table.
5786 If there is an active region, convert it to a table. If there is no such
5787 region, create an empty table."
5790 (org-table-convert-region (region-beginning) (region-end) arg)
5791 (org-table-create arg)))
5793 (defun org-table-create (&optional size)
5794 "Query for a size and insert a table skeleton.
5800 org-table-default-size "]: ")
5801 "" nil org-table-default-size)))
5823 (org-table-align)))
5825 (defun org-table-convert-region (beg0 end0 &optional nspace)
5826 "Convert region to a table.
5858 (org-table-align)))
5860 (defun org-table-import (file arg)
5861 "Import FILE as a table.
5870 (org-table-convert-region beg (+ (point) (- (point-max) pm)) arg)))
5872 (defun org-table-export ()
5873 "Export table as a tab-separated file.
5876 (let* ((beg (org-table-begin))
5877 (end (org-table-end))
5878 (table (buffer-substring beg end))
5879 (file (read-file-name "Export table to: "))
5888 (insert table)
5908 (defvar org-table-aligned-begin-marker (make-marker)
5909 "Marker at the beginning of the table last aligned.
5910 Used to check if cursor still is in that table, to minimize realignment.")
5911 (defvar org-table-aligned-end-marker (make-marker)
5912 "Marker at the end of the table last aligned.
5913 Used to check if cursor still is in that table, to minimize realignment.")
5914 (defvar org-table-last-alignment nil
5917 (defvar org-table-last-column-widths nil
5920 (defvar org-table-overlay-coordinates nil
5921 "Overlay coordinates after each align of a table.")
5922 (make-variable-buffer-local 'org-table-overlay-coordinates)
5926 "Used as display property in narrowed table columns.")
5928 (defun org-table-align ()
5929 "Align the table at point by aligning all vertical bars."
5932 ;; Limits of table
5933 (beg (org-table-begin))
5934 (end (org-table-end))
5937 (colpos (org-table-current-column))
5940 lines (new "") lengths l typenums ty fields maxfields i
5994 (org-table-create org-table-default-size)
5995 (error "Empty table - created default table")))
6016 (concat "Clipped table field, use C-c ` to edit. Full value is:\n" (org-no-properties (copy-sequence xx))))
6033 (if (string-match org-table-number-regexp x) 1 0))
6035 (push (>= frac org-table-number-fraction) typenums))
6038 ;; Store the alignment of this table, for later editing of single fields
6039 (setq org-table-last-alignment typenums
6040 org-table-last-column-widths lengths)
6054 ;; Compute the formats needed for output of the table
6063 (setq new (mapconcat
6072 (move-marker org-table-aligned-begin-marker (point))
6073 (insert new)
6074 (move-marker org-table-aligned-end-marker (point))
6076 (goto-char org-table-aligned-begin-marker)
6077 (while (org-hide-wide-columns org-table-aligned-end-marker)))
6083 (org-table-goto-column colpos)
6084 (and org-table-overlay-coordinates (org-table-overlay-coordinates))
6085 (setq org-table-may-need-update nil)
6110 (defun org-table-begin (&optional table-type)
6111 "Find the beginning of the table and return its position.
6112 With argument TABLE-TYPE, go to the beginning of a table.el-type table."
6115 (if table-type org-table-any-border-regexp
6116 org-table-border-regexp)
6123 (defun org-table-end (&optional table-type)
6124 "Find the end of the table and return its position.
6125 With argument TABLE-TYPE, go to the end of a table.el-type table."
6128 (if table-type org-table-any-border-regexp
6129 org-table-border-regexp)
6135 (defun org-table-justify-field-maybe (&optional new)
6139 ((and (not new) org-table-may-need-update)) ; Realignment will happen anyway
6140 ((org-at-table-hline-p))
6141 ((and (not new)
6142 (or (not (equal (marker-buffer org-table-aligned-begin-marker)
6144 (< (point) org-table-aligned-begin-marker)
6145 (>= (point) org-table-aligned-end-marker)))
6146 ;; This is not the same table, force a full re-align
6147 (setq org-table-may-need-update t))
6150 (col (org-table-current-column))
6151 (num (if (> col 0) (nth (1- col) org-table-last-alignment)))
6162 l (if e "|" (setq org-table-may-need-update t) ""))
6164 (if new
6165 (if (<= (length new) l) ;; FIXME: length -> str-width?
6166 (setq n (format f new))
6167 (setq n (concat new "|") org-table-may-need-update t)))
6169 (let (org-table-may-need-update)
6171 (setq org-table-may-need-update t))
6174 (defun org-table-next-field ()
6175 "Go to the next field in the current table, creating new lines as needed.
6176 Before doing so, re-align the table if necessary."
6178 (org-table-maybe-eval-formula)
6179 (org-table-maybe-recalculate-line)
6180 (if (and org-table-automatic-realign
6181 org-table-may-need-update)
6182 (org-table-align))
6183 (let ((end (org-table-end)))
6184 (if (org-at-table-hline-p)
6192 org-table-tab-jumps-over-hlines
6198 (org-table-insert-row 'below))
6201 (org-table-insert-row 'below)))))
6203 (defun org-table-previous-field ()
6204 "Go to the previous field in the table.
6205 Before doing so, re-align the table if necessary."
6207 (org-table-justify-field-maybe)
6208 (org-table-maybe-recalculate-line)
6209 (if (and org-table-automatic-realign
6210 org-table-may-need-update)
6211 (org-table-align))
6212 (if (org-at-table-hline-p)
6214 (re-search-backward "|" (org-table-begin))
6215 (re-search-backward "|" (org-table-begin))
6217 (re-search-backward "|" (org-table-begin)))
6221 (defun org-table-next-row ()
6222 "Go to the next row (same column) in the current table.
6223 Before doing so, re-align the table if necessary."
6225 (org-table-maybe-eval-formula)
6226 (org-table-maybe-recalculate-line)
6230 (if (and org-table-automatic-realign
6231 org-table-may-need-update)
6232 (org-table-align))
6233 (let ((col (org-table-current-column)))
6235 (if (or (not (org-at-table-p))
6236 (org-at-table-hline-p))
6239 (org-table-insert-row 'below)))
6240 (org-table-goto-column col)
6244 (defun org-table-copy-down (n)
6251 If the variable `org-table-copy-increment' is non-nil and the field is an
6254 (let* ((colpos (org-table-current-column))
6255 (field (org-table-get-field))
6257 (beg (org-table-begin))
6259 (org-table-check-inside-data-field)
6263 (org-table-next-row)
6264 (org-table-blank-field))
6269 (re-search-backward org-table-dataline-regexp
6271 (org-table-goto-column colpos t)
6278 (if (and org-table-copy-increment
6282 (org-table-maybe-recalculate-line)
6283 (org-table-align))
6286 (defun org-table-check-inside-data-field ()
6287 "Is point inside a table data field?
6290 (if (or (not (org-at-table-p))
6291 (= (org-table-current-column) 0)
6292 (org-at-table-hline-p)
6294 (error "Not in table data field")))
6296 (defvar org-table-clip nil
6297 "Clipboard for table regions.")
6299 (defun org-table-blank-field ()
6300 "Blank the current table field or active region."
6302 (org-table-check-inside-data-field)
6304 (let (org-table-clip)
6305 (org-table-cut-region (region-beginning) (region-end)))
6316 (defun org-table-get-field (&optional n replace)
6321 (and n (org-table-goto-column n))
6334 (defun org-table-field-info (arg)
6337 (org-table-get-specials)
6340 (col (org-table-current-column))
6341 (cname (car (rassoc (int-to-string col) org-table-column-names)))
6343 org-table-named-field-locations)))
6344 (eql (org-table-get-stored-formulas))
6345 (dline (org-table-current-dline))
6358 ;; FIXME: formula info not correct if special table line
6364 (defun org-table-current-column ()
6368 (if (interactive-p) (org-table-check-inside-data-field))
6374 (if (interactive-p) (message "This is table column %d" cnt))
6377 (defun org-table-current-dline ()
6378 "Find out what table data line we are in.
6381 (if (interactive-p) (org-table-check-inside-data-field))
6384 (goto-char (org-table-begin))
6386 (if (looking-at org-table-dataline-regexp) (setq cnt (1+ cnt)))
6388 (if (interactive-p) (message "This is table line %d" cnt))
6391 (defun org-table-goto-column (n &optional on-delim force)
6392 "Move the cursor to the Nth column in the current table line.
6396 However, when FORCE is non-nil, create new columns if necessary."
6414 (defun org-at-table-p (&optional table-type)
6415 "Return t if the cursor is inside an org-type table.
6416 If TABLE-TYPE is non-nil, also check for table.el-type tables."
6417 (if org-enable-table-editor
6420 (looking-at (if table-type org-table-any-line-regexp
6421 org-table-line-regexp)))
6424 (defun org-at-table.el-p ()
6425 "Return t if and only if we are at a table.el table."
6426 (and (org-at-table-p 'any)
6428 (goto-char (org-table-begin 'any))
6431 (defun org-table-recognize-table.el ()
6432 "If there is a table.el table nearby, recognize it and move into it."
6433 (if org-table-tab-recognizes-table.el
6434 (if (org-at-table.el-p)
6437 (if (looking-at org-table-dataline-regexp)
6442 (if (looking-at org-table-any-border-regexp)
6444 (if (re-search-forward "|" (org-table-end t) t)
6446 (require 'table)
6447 (if (table--at-cell-p (point))
6449 (message "recognizing table.el table...")
6450 (table-recognize-table)
6451 (message "recognizing table.el table...done")))
6457 (defun org-at-table-hline-p ()
6458 "Return t if the cursor is inside a hline in a table."
6459 (if org-enable-table-editor
6462 (looking-at org-table-hline-regexp))
6465 (defun org-table-insert-column ()
6466 "Insert a new column into the table."
6468 (if (not (org-at-table-p))
6469 (error "Not at a table"))
6470 (org-table-find-dataline)
6471 (let* ((col (max 1 (org-table-current-column)))
6472 (beg (org-table-begin))
6473 (end (org-table-end))
6479 (if (org-at-table-hline-p)
6481 (org-table-goto-column col t)
6486 (org-table-goto-column colpos)
6487 (org-table-align)
6488 (org-table-fix-formulas "$" nil (1- col) 1)))
6490 (defun org-table-find-dataline ()
6491 "Find a dataline in the current table, which is needed for column commands."
6492 (if (and (org-at-table-p)
6493 (not (org-at-table-hline-p)))
6496 (end (org-table-end)))
6500 (org-at-table-hline-p)))
6503 (if (and (org-at-table-p)
6504 (not (org-at-table-hline-p)))
6509 (defun org-table-delete-column ()
6510 "Delete a column from the table."
6512 (if (not (org-at-table-p))
6513 (error "Not at a table"))
6514 (org-table-find-dataline)
6515 (org-table-check-inside-data-field)
6516 (let* ((col (org-table-current-column))
6517 (beg (org-table-begin))
6518 (end (org-table-end))
6524 (if (org-at-table-hline-p)
6526 (org-table-goto-column col t)
6532 (org-table-goto-column colpos)
6533 (org-table-align)
6534 (org-table-fix-formulas "$" (list (cons (number-to-string col) "INVALID"))
6537 (defun org-table-move-column-right ()
6540 (org-table-move-column nil))
6541 (defun org-table-move-column-left ()
6544 (org-table-move-column 'left))
6546 (defun org-table-move-column (&optional left)
6549 (if (not (org-at-table-p))
6550 (error "Not at a table"))
6551 (org-table-find-dataline)
6552 (org-table-check-inside-data-field)
6553 (let* ((col (org-table-current-column))
6555 (beg (org-table-begin))
6556 (end (org-table-end))
6566 (if (org-at-table-hline-p)
6568 (org-table-goto-column col1 t)
6574 (org-table-goto-column colpos)
6575 (org-table-align)
6576 (org-table-fix-formulas
6580 (defun org-table-move-row-down ()
6581 "Move table row down."
6583 (org-table-move-row nil))
6584 (defun org-table-move-row-up ()
6585 "Move table row up."
6587 (org-table-move-row 'up))
6589 (defun org-table-move-row (&optional up)
6590 "Move the current table line down. With arg UP, move it up."
6595 (looking-at org-table-hline-regexp)))
6596 (dline1 (org-table-current-dline))
6601 (unless (org-at-table-p)
6604 (setq hline2p (looking-at org-table-hline-regexp))
6615 (org-table-fix-formulas
6619 (defun org-table-insert-row (&optional arg)
6620 "Insert a new row above the current line into the table.
6623 (if (not (org-at-table-p))
6624 (error "Not at a table"))
6626 (new (org-table-clean-line line)))
6629 (setq new (replace-match (match-string 0 line) t t new)))
6631 (let (org-table-may-need-update) (insert-before-markers new "\n"))
6634 (and (or org-table-may-need-update org-table-overlay-coordinates)
6635 (org-table-align))
6636 (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))
6638 (defun org-table-insert-hline (&optional arg)
6639 "Insert a horizontal-line below the current line into the table.
6642 (if (not (org-at-table-p))
6643 (error "Not at a table"))
6644 (let ((line (org-table-clean-line
6656 (and org-table-overlay-coordinates (org-table-align))))
6658 (defun org-table-clean-line (s)
6659 "Convert a table line S into a string with only \"|\" and space.
6671 (defun org-table-kill-row ()
6672 "Delete the current row or horizontal line from the table."
6674 (if (not (org-at-table-p))
6675 (error "Not at a table"))
6677 (dline (org-table-current-dline)))
6679 (if (not (org-at-table-p)) (beginning-of-line 0))
6681 (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))
6685 (defun org-table-sort-lines (with-case &optional sorting-type)
6686 "Sort table lines according to the column at point.
6690 horizontal separator lines, or the entire table of no such lines
6708 (thiscol (org-table-current-column))
6716 (org-table-goto-column thiscol))
6717 (org-table-check-inside-data-field)
6722 (setq column (org-table-current-column)
6726 (setq column (org-table-current-column)
6728 tbeg (org-table-begin)
6729 tend (org-table-end))
6730 (if (re-search-backward org-table-hline-regexp tbeg t)
6735 (if (re-search-forward org-table-hline-regexp tend t)
6743 (org-table-goto-column column)
6746 (org-table-goto-column (1+ column))
6749 (org-table-goto-column column)
6758 (org-table-goto-column thiscol)
6761 (defun org-table-cut-region (beg end)
6762 "Copy region in table to the clipboard and blank all relevant fields."
6764 (org-table-copy-region beg end 'cut))
6766 (defun org-table-copy-region (beg end &optional cut)
6767 "Copy rectangular region in table to clipboard.
6769 with `org-table-paste-rectangle'."
6775 (org-table-check-inside-data-field)
6777 c01 (org-table-current-column))
6779 (org-table-check-inside-data-field)
6781 c02 (org-table-current-column))
6789 (if (org-at-table-hline-p) (throw 'nextline (setq l1 (1+ l1))))
6792 (push (org-table-get-field ic1 rpl) cols)
6796 (setq org-table-clip (nreverse region))
6797 (if cut (org-table-align))
6798 org-table-clip))
6800 (defun org-table-paste-rectangle ()
6801 "Paste a rectangular region into a table.
6803 will be overwritten. If the rectangle does not fit into the present table,
6804 the table is enlarged as needed. The process ignores horizontal separator
6807 (unless (and org-table-clip (listp org-table-clip))
6809 (org-table-check-inside-data-field)
6810 (let* ((clip org-table-clip)
6812 (col (org-table-current-column))
6813 (org-enable-table-editor t)
6814 (org-table-automatic-realign nil)
6817 (while (org-at-table-hline-p) (beginning-of-line 2))
6818 (if (not (org-at-table-p))
6819 (progn (end-of-line 0) (org-table-next-field)))
6822 (org-table-goto-column c nil 'force)
6823 (org-table-get-field nil field)
6827 (org-table-goto-column col)
6828 (org-table-align)))
6830 (defun org-table-convert ()
6831 "Convert from `org-mode' table to table.el and back.
6832 Obviously, this only works within limits. When an Org-mode table is
6833 converted to table.el, all horizontal separator lines get lost, because
6834 table.el uses these as cell boundaries and has no notion of horizontal lines.
6835 A table.el table can be converted to an Org-mode table only if it does not
6837 Beware, Org-mode does not test if the table can be successfully converted - it
6840 (require 'table)
6841 (if (org-at-table.el-p)
6842 ;; convert to Org-mode table
6843 (let ((beg (move-marker (make-marker) (org-table-begin t)))
6844 (end (move-marker (make-marker) (org-table-end t))))
6845 (table-unrecognize-region beg end)
6850 (if (org-at-table-p)
6851 ;; convert to table.el table
6852 (let ((beg (move-marker (make-marker) (org-table-begin)))
6853 (end (move-marker (make-marker) (org-table-end))))
6860 (org-table-insert-hline 'above)
6864 (org-table-insert-hline))
6866 (setq end (move-marker end (org-table-end)))
6875 (defun org-table-wrap-region (arg)
6878 lines, in order to keep the table compact.
6882 lines. Generally, this makes the table more compact. A prefix ARG may be
6883 used to change the number of desired lines. For example, `C-2 \\[org-table-wrap]'
6887 into the table. If you formatted it to more lines than it was before, fields
6888 further down in the table get overwritten - so you might need to make space in
6889 the table first.
6898 (org-table-check-inside-data-field)
6903 (ccol (save-excursion (goto-char beg) (org-table-current-column)))
6905 (org-table-cut-region (region-beginning) (region-end))
6906 (if (> (length (car org-table-clip)) 1)
6910 (+ (length org-table-clip) arg)
6912 (length org-table-clip)))
6913 (setq org-table-clip
6914 (mapcar 'list (org-wrap (mapconcat 'car org-table-clip " ")
6917 (org-table-goto-column ccol)
6918 (org-table-paste-rectangle))
6922 (let ((s (org-table-blank-field))
6923 (col (org-table-current-column)))
6925 (while (org-at-table-hline-p) (beginning-of-line 0))
6926 (org-table-goto-column col)
6930 (org-table-align))
6936 (org-table-next-row)
6938 (org-table-align))))))
6942 (defun org-table-edit-field (arg)
6943 "Edit table field in a different window.
6956 (field (org-table-get-field))
6970 'org-table-finish-edit-field)
6975 (defun org-table-finish-edit-field ()
6976 "Finish editing a table data field.
6977 Remove all newline characters, insert the result into the table, realign
6978 the table and kill the editing buffer."
6993 (org-table-check-inside-data-field)
6994 (org-table-get-field nil text)
6995 (org-table-align)
7068 (defun org-table-map-tables (function)
7074 (while (re-search-forward org-table-any-line-regexp nil t)
7077 (if (looking-at org-table-line-regexp)
7079 (re-search-forward org-table-any-border-regexp nil 1))))
7084 (defun org-table-sum (&optional beg end nlast)
7085 "Sum numbers in region of current table column.
7091 region and point is located in a table column, sum all numbers in that
7101 (let (col (org-timecnt 0) diff h m s org-table-clip)
7107 (setq col (org-table-current-column))
7108 (goto-char (org-table-begin))
7110 (error "No table data"))
7111 (org-table-goto-column col)
7113 (goto-char (org-table-end))
7115 (error "No table data"))
7116 (org-table-goto-column col)
7118 (let* ((items (apply 'append (org-table-copy-region beg end)))
7124 (numbers (delq nil (mapcar 'org-table-get-number-for-summing
7134 (kill-new sres)
7142 (defun org-table-get-number-for-summing (s)
7162 (defun org-table-current-field-formula ()
7166 (org-table-current-column))
7167 org-table-named-field-locations)))
7168 (col (org-table-current-column))
7170 (ref (format "@%d$%d" (org-table-current-dline) col))
7171 (stored-list (org-table-get-stored-formulas))
7178 (defun org-table-get-formula (&optional equation named)
7181 (let* ((stored-list (org-table-get-stored-formulas))
7183 (org-table-current-column))
7184 org-table-named-field-locations)))
7185 (ref (format "@%d$%d" (org-table-current-dline)
7186 (org-table-current-column)))
7190 (int-to-string (org-table-current-column))))
7195 (org-table-may-need-update nil)
7204 (or stored "") 'org-table-formula-history
7211 (org-table-store-formulas stored-list)
7223 (org-table-store-formulas stored-list))
7226 (defun org-table-store-formulas (alist)
7227 "Store the list of formulas below the current table."
7230 (goto-char (org-table-end))
7245 (defun org-table-get-stored-formulas ()
7246 "Return an alist with the stored formulas directly after current table."
7250 (goto-char (org-table-end))
7265 (defun org-table-fix-formulas (key replace &optional limit delta remove)
7266 "Modify the equations after the table structure has been edited.
7270 (goto-char (org-table-end))
7290 (defun org-table-get-specials ()
7291 "Get the column names and local parameters for this table."
7293 (let ((beg (org-table-begin)) (end (org-table-end))
7296 (setq org-table-column-names nil
7297 org-table-local-parameters nil
7298 org-table-named-field-locations nil
7299 org-table-current-begin-line nil
7300 org-table-current-line-types nil)
7308 (push (cons name (int-to-string cnt)) org-table-column-names))))
7309 (setq org-table-column-names (nreverse org-table-column-names))
7310 (setq org-table-column-name-regexp
7311 (concat "\\$\\(" (mapconcat 'car org-table-column-names "\\|") "\\)\\>"))
7318 org-table-local-parameters))))
7332 (push (cons field v) org-table-local-parameters)
7333 (push (list field line col) org-table-named-field-locations))))
7336 (setq org-table-current-begin-line (org-current-line)
7337 l org-table-current-begin-line)
7343 (setq org-table-current-line-types (apply 'vector (nreverse types))
7344 org-table-dlines (apply 'vector (cons nil (nreverse dlines)))
7345 org-table-hlines (apply 'vector (cons nil (nreverse hlines)))))))
7354 (defun org-table-maybe-eval-formula ()
7357 ;; We already know we are in a table. Get field will only return a formula
7359 (when org-table-formula-evaluate-inline
7360 (let* ((field (org-trim (or (org-table-get-field) "")))
7367 (org-table-eval-formula (if named '(4) nil) eq)
7377 ("*" . "Recalculate only when entire table is recalculated with `C-u C-c *'")
7383 (defun org-table-rotate-recalc-marks (&optional newchar)
7386 insert a new column for the markers.
7390 of the new mark."
7392 (unless (org-at-table-p) (error "Not at a table"))
7394 (beg (org-table-begin))
7395 (end (org-table-end))
7403 (col (org-table-current-column))
7405 epos new)
7411 (error "Invalid NEWCHAR `%s' in `org-table-rotate-recalc-marks'"
7416 (unless (looking-at org-table-dataline-regexp)
7417 (error "Not at a table data line")))
7419 (org-table-goto-column 1)
7420 (org-table-insert-column)
7421 (org-table-goto-column (1+ col)))
7425 (org-table-get-field
7428 (setq new (or forcenew
7436 (and (looking-at org-table-dataline-regexp)
7437 (org-table-get-field 1 (concat " " new " "))))
7439 (if (not (= epos (point-at-eol))) (org-table-align))
7441 (and (interactive-p) (message (cdr (assoc new org-recalc-marks))))))
7443 (defun org-table-maybe-recalculate-line ()
7446 (and org-table-allow-automatic-line-recalculation
7450 (looking-at org-table-auto-recalculate-regexp))
7451 (org-table-recalculate) t))
7453 (defvar org-table-formula-debug nil
7454 "Non-nil means, debug table formulas.
7456 (make-variable-buffer-local 'org-table-formula-debug)
7471 (defun org-table-eval-formula (&optional arg equation
7474 "Replace the table field value at the cursor by the result of a calculation.
7480 In a table, this command replaces the value in the current field with the
7482 formula, by storing it in a special line below the table. When called
7510 (org-table-check-inside-data-field)
7511 (or suppress-analysis (org-table-get-specials))
7513 (let ((eq (org-table-current-field-formula)))
7515 (org-table-get-field nil eq)
7516 (org-table-align)
7517 (setq org-table-may-need-update t))
7520 (org-table-automatic-realign nil)
7525 (org-table-get-formula equation (equal arg '(4)))))
7526 (n0 (org-table-current-column))
7536 fmt (concat (cdr (assoc "%" org-table-local-parameters))
7560 (if (and (not suppress-const) org-table-formula-use-constants)
7561 (setq formula (org-table-formula-substitute-names formula)))
7578 (while (string-match org-table-range-regexp form)
7582 (org-table-make-reference
7583 (org-table-get-range (match-string 0 form) nil n0)
7591 (org-table-make-reference
7608 (org-table-make-reference x nil numbers lispp))
7620 (when org-table-formula-debug
7638 (org-table-align)
7643 (org-table-justify-field-maybe
7648 (and down (org-table-maybe-recalculate-line))
7649 (or suppress-align (and org-table-may-need-update
7650 (org-table-align))))))
7652 (defun org-table-get-range (desc &optional tbeg col highlight)
7654 Optional arguments TBEG and COL can give the beginning of the table and
7660 (or tbeg (setq tbeg (org-table-begin)))
7661 (or col (setq col (org-table-current-column)))
7664 (unless (string-match org-table-range-regexp desc)
7665 (error "Invalid table range specifier `%s'" desc))
7678 (if r1 (setq r1 (org-table-get-descriptor-line r1)))
7679 (if r2 (setq r2 (org-table-get-descriptor-line r2)))
7689 (while (not (looking-at org-table-dataline-regexp))
7691 (prog1 (org-table-get-field c1)
7692 (if highlight (org-table-highlight-rectangle (point) (point)))))
7698 (while (not (looking-at org-table-dataline-regexp))
7700 (org-table-goto-column c1)
7703 (while (not (looking-at org-table-dataline-regexp))
7705 (org-table-goto-column c2)
7708 (org-table-highlight-rectangle
7711 (apply 'append (org-table-copy-region beg end))))))
7713 (defun org-table-get-descriptor-line (desc &optional cline bline table)
7715 The cursor is currently in line CLINE, the table begins in line BLINE,
7718 (aref org-table-dlines (string-to-number desc))
7720 bline (or bline org-table-current-begin-line)
7721 table (or table org-table-current-line-types))
7739 (if (eq (aref table 0) 'hline) (setq hn (1- hn)))))
7741 (error "should never happen");;(aref org-table-dlines on) FIXME
7743 (setq i (org-find-row-type table i 'hline (equal hdir "-") nil hn)))
7745 (setq i (org-find-row-type table i 'dline (equal odir "-") rel on)))
7748 (defun org-find-row-type (table i type backwards relative n)
7749 (let ((l (length table)))
7753 (not (eq (aref table i) type))
7754 (if (and relative (eq (aref table i) 'hline))
7759 (error "Row descriptior leads outside table")
7767 (defun org-table-make-reference (elements keep-empty numbers lispp)
7793 (defun org-table-recalculate (&optional all noalign)
7794 "Recalculate the current table line by applying all stored formulas.
7795 With prefix arg ALL, do this for all lines in the table."
7799 (unless (org-at-table-p) (error "Not at a table"))
7801 (org-table-iterate)
7802 (org-table-get-specials)
7803 (let* ((eqlist (sort (org-table-get-stored-formulas)
7806 (line-re org-table-dataline-regexp)
7808 (thiscol (org-table-current-column))
7813 (setcdr x (org-table-formula-substitute-names (cdr x)))
7824 (setq end (move-marker (make-marker) (1+ (org-table-end))))
7825 (goto-char (setq beg (org-table-begin)))
7826 (if (re-search-forward org-table-calculate-mark-regexp end t)
7827 ;; This is a table with marked lines, compute selected lines
7828 (setq line-re org-table-recalculate-regexp)
7830 (if (and (re-search-forward org-table-dataline-regexp end t)
7831 (re-search-forward org-table-hline-regexp end t)
7832 (re-search-forward org-table-dataline-regexp end t))
7838 (and all (message "Re-applying formulas to full table..."))
7840 (unless (string-match "^ *[_^!$] *$" (org-table-get-field 1))
7842 (and all (message "Re-applying formulas to full table...(line %d)"
7848 (org-table-goto-column (string-to-number (car entry)) nil 'force)
7849 (org-table-eval-formula nil (cdr entry)
7852 (org-table-goto-column thiscol)
7853 (or noalign (and org-table-may-need-update (org-table-align))
7858 a (assoc name org-table-named-field-locations))
7864 (aref org-table-dlines
7870 (org-table-goto-column (nth 2 a))
7871 (org-table-eval-formula nil (cdr eq) 'noalign 'nocst
7876 (org-table-goto-column thiscol)
7877 (or noalign (and org-table-may-need-update (org-table-align))
7880 (defun org-table-iterate (&optional arg)
7881 "Recalculate the table until it does not change anymore."
7885 (lasttbl (buffer-substring (org-table-begin) (org-table-end)))
7890 (org-table-recalculate 'all)
7891 (setq thistbl (buffer-substring (org-table-begin) (org-table-end)))
7900 (defun org-table-formula-substitute-names (f)
7904 (while (setq start (string-match org-table-column-name-regexp f start))
7906 (setq a (assoc (match-string 1 f) org-table-column-names))
7913 (org-table-get-constant (match-string 1 f))))
7915 (if org-table-formula-debug
7919 (defun org-table-get-constant (const)
7922 (or (cdr (assoc const org-table-local-parameters))
7923 (cdr (assoc const org-table-formula-constants))
7931 (define-key org-edit-formulas-map [(shift up)] 'org-table-edit-line-up)
7932 (define-key org-edit-formulas-map [(shift down)] 'org-table-edit-line-down)
7933 (define-key org-edit-formulas-map [(shift left)] 'org-table-edit-backward-field)
7934 (define-key org-edit-formulas-map [(shift right)] 'org-table-edit-next-field)
7935 (define-key org-edit-formulas-map [(meta up)] 'org-table-edit-scroll-down)
7936 (define-key org-edit-formulas-map [(meta down)] 'org-table-edit-scroll)
7944 (defun org-table-edit-formulas ()
7945 "Edit the formulas of the current table in a separate buffer."
7947 (unless (org-at-table-p) (error "Not at a table"))
7948 (org-table-get-specials)
7949 (let ((eql (org-table-get-stored-formulas))
7962 (org-add-hook 'post-command-hook 'org-table-edit-formulas-post-command t t)
7965 # `M-up/down' to scroll table, `S-up/down' to change line for column formulas\n\n")
7977 (defun org-table-edit-formulas-post-command ()
7988 With prefix ARG, apply the new formulas to the table."
7990 (org-table-remove-rectangle-highlight)
8006 (unless (org-at-table-p)
8007 (error "Lost table position - cannot install formulae"))
8008 (org-table-store-formulas eql)
8012 (org-table-recalculate 'all)
8018 (org-table-remove-rectangle-highlight)
8070 (org-table-remove-rectangle-highlight)
8078 (if local (org-table-get-specials))
8080 ((org-at-regexp-p org-table-range-regexp2) 'range)
8087 (org-table-add-rectangle-overlay (match-beginning 0) (match-end 0)
8090 'org-table-remove-rectangle-highlight)
8094 (setq match (org-table-formula-substitute-names match)))
8100 (org-table-add-rectangle-overlay
8108 (org-table-force-dataline)
8113 (setq e (assoc name org-table-named-field-locations))
8115 (org-table-goto-column (nth 2 e)))
8119 (goto-line (aref org-table-dlines l))
8120 (org-table-goto-column c)))
8121 (t (org-table-goto-column (string-to-number name))))
8123 (org-table-highlight-rectangle nil nil face2))
8130 (org-table-get-range match nil nil 'highlight))
8132 ((setq e (assoc var org-table-named-field-locations))
8134 (org-table-goto-column (nth 2 e))
8135 (org-table-highlight-rectangle (point) (point))
8137 ((setq e (assoc var org-table-column-names))
8138 (org-table-goto-column (string-to-number (cdr e)))
8139 (org-table-highlight-rectangle (point) (point))
8140 (goto-char (org-table-begin))
8142 (org-table-end) t)
8145 (org-table-highlight-rectangle)
8150 (org-table-goto-column (string-to-number (substring match 1)))
8151 (org-table-highlight-rectangle (point) (point))
8153 ((setq e (assoc var org-table-local-parameters))
8154 (goto-char (org-table-begin))
8158 (org-table-highlight-rectangle)
8164 ((setq e (assoc var org-table-formula-constants))
8165 (message "Constant: $%s=%s in `org-table-formula-constants'."
8182 (defun org-table-force-dataline ()
8183 "Make sure the cursor is in a dataline in a table."
8186 (looking-at org-table-dataline-regexp))
8187 (let* ((re org-table-dataline-regexp)
8194 (t (error "No table dataline around here"))))))
8196 (defun org-table-edit-line-up ()
8197 "Move cursor one line up in the window showing the table."
8199 (org-table-edit-move 'previous-line))
8201 (defun org-table-edit-line-down ()
8202 "Move cursor one line down in the window showing the table."
8204 (org-table-edit-move 'next-line))
8206 (defun org-table-edit-backward-field ()
8207 "Move cursor one field backward in the window showing the table."
8209 (org-table-edit-move 'org-table-previous-field))
8211 (defun org-table-edit-next-field ()
8212 "Move cursor one field forward in the window showing the table."
8214 (org-table-edit-move 'org-table-next-field))
8216 (defun org-table-edit-move (command)
8217 "Move the cursor in the window shoinw the table.
8219 (let ((org-table-allow-automatic-line-recalculation nil)
8224 (while (and (org-at-table-p)
8225 (org-at-table-hline-p))
8227 (or (org-at-table-p) (goto-char p))
8231 (defun org-table-edit-scroll (N)
8236 (defun org-table-edit-scroll-down (N)
8238 (org-table-edit-scroll (- N)))
8240 (defvar org-table-rectangle-overlays nil)
8242 (defun org-table-add-rectangle-overlay (beg end &optional face)
8243 "Add a new overlay."
8246 (push ov org-table-rectangle-overlays)))
8248 (defun org-table-highlight-rectangle (&optional beg end face)
8249 "Highlight rectangular region in a table."
8258 c1 (org-table-current-column))
8261 c2 (org-table-current-column))
8266 (when (looking-at org-table-dataline-regexp)
8267 (org-table-goto-column c1)
8269 (org-table-goto-column c2)
8271 (org-table-add-rectangle-overlay beg end face))
8274 (add-hook 'before-change-functions 'org-table-remove-rectangle-highlight))
8276 (defun org-table-remove-rectangle-highlight (&rest ignore)
8279 (remove-hook 'before-change-functions 'org-table-remove-rectangle-highlight)
8280 (mapc 'org-delete-overlay org-table-rectangle-overlays)
8281 (setq org-table-rectangle-overlays nil)))
8283 (defvar org-table-coordinate-overlays nil
8285 (make-variable-buffer-local 'org-table-coordinate-overlays)
8287 (defun org-table-overlay-coordinates ()
8288 "Add overlays to the table at point, to show row/column coordinates."
8290 (mapc 'org-delete-overlay org-table-coordinate-overlays)
8291 (setq org-table-coordinate-overlays nil)
8294 (goto-char (org-table-begin))
8295 (while (org-at-table-p)
8298 (push ov org-table-coordinate-overlays)
8299 (setq hline (looking-at org-table-hline-regexp))
8309 (push ov org-table-coordinate-overlays)
8313 (defun org-table-toggle-coordinate-overlays ()
8316 (setq org-table-overlay-coordinates (not org-table-overlay-coordinates))
8318 (if org-table-overlay-coordinates "on" "off"))
8319 (if (and (org-at-table-p) org-table-overlay-coordinates)
8320 (org-table-align))
8321 (unless org-table-overlay-coordinates
8322 (mapc 'org-delete-overlay org-table-coordinate-overlays)
8323 (setq org-table-coordinate-overlays nil)))
8325 (defun org-table-toggle-formula-debugger ()
8328 (setq org-table-formula-debug (not org-table-formula-debug))
8330 (if org-table-formula-debug "on" "off")))
8335 ;; integrate the org-mode table editor.
8337 ;; This is really a hack, because the org-mode table editor uses several
8340 ;; necessary to operate the table editor, but wraps the commands into a
8341 ;; function which tests if the cursor is currently inside a table. If that
8342 ;; is the case, the table editor command is executed. However, when any of
8343 ;; those keys is used outside a table, the function uses `key-binding' to
8346 ;; There might be problems if any of the keys used by the table editor is
8362 table editor in arbitrary modes.")
8381 0 (quote 'org-table) 'prepend))
8386 "The `org-mode' table editor as a minor mode for use in other modes."
8401 (org-set-local (quote org-table-may-need-update) t)
8446 "Create a function for binding in the table minor mode.
8447 FUN is the command to call inside a table. N is used to create a unique
8460 '(org-at-table-p)
8471 "Error when there is no default binding for a table key."
8480 '([(meta shift left)] org-table-delete-column)
8481 '([(meta left)] org-table-move-column-left)
8482 '([(meta right)] org-table-move-column-right)
8483 '([(meta shift right)] org-table-insert-column)
8484 '([(meta shift up)] org-table-kill-row)
8485 '([(meta shift down)] org-table-insert-row)
8486 '([(meta up)] org-table-move-row-up)
8487 '([(meta down)] org-table-move-row-down)
8488 '("\C-c\C-w" org-table-cut-region)
8489 '("\C-c\M-w" org-table-copy-region)
8490 '("\C-c\C-y" org-table-paste-rectangle)
8491 '("\C-c-" org-table-insert-hline)
8492 '("\C-c}" org-table-toggle-coordinate-overlays)
8493 '("\C-c{" org-table-toggle-formula-debugger)
8494 '("\C-m" org-table-next-row)
8495 (list (org-key 'S-return) 'org-table-copy-down)
8496 '("\C-c\C-q" org-table-wrap-region)
8497 '("\C-c?" org-table-field-info)
8498 '("\C-c " org-table-blank-field)
8499 '("\C-c+" org-table-sum)
8500 '("\C-c=" org-table-eval-formula)
8501 '("\C-c'" org-table-edit-formulas)
8502 '("\C-c`" org-table-edit-field)
8503 '("\C-c*" org-table-recalculate)
8504 '("\C-c|" org-table-create-or-convert-from-region)
8505 '("\C-c^" org-table-sort-lines)
8506 '([(control ?#)] org-table-rotate-recalc-marks)))
8527 (orgtbl-make-binding 'org-table-previous-field 104
8531 (orgtbl-make-binding 'org-table-wrap-region 105
8534 (orgtbl-make-binding 'org-table-wrap-region 106
8539 ;; If the user wants maximum table support, we need to hijack
8548 ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
8549 ["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"]
8550 ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"]
8551 ["Next Row" org-return :active (org-at-table-p) :keys "RET"]
8553 ["Blank Field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"]
8554 ["Edit Field" org-table-edit-field :active (org-at-table-p) :keys "C-c ` "]
8556 org-table-copy-down :active (org-at-table-p) :keys "S-RET"]
8559 ["Move Column Left" org-metaleft :active (org-at-table-p) :keys "M-<left>"]
8560 ["Move Column Right" org-metaright :active (org-at-table-p) :keys "M-<right>"]
8561 ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-<left>"]
8562 ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-<right>"])
8564 ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-<up>"]
8565 ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"]
8566 ["Delete Row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"]
8567 ["Insert Row" org-shiftmetadown :active (org-at-table-p) :keys "M-S-<down>"]
8568 ["Sort lines in region" org-table-sort-lines (org-at-table-p) :keys "C-c ^"]
8570 ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"])
8572 ["Copy Rectangle" org-copy-special :active (org-at-table-p)]
8573 ["Cut Rectangle" org-cut-special :active (org-at-table-p)]
8574 ["Paste Rectangle" org-paste-special :active (org-at-table-p)]
8575 ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p)])
8578 ["Insert table template" orgtbl-insert-radio-table
8579 (assq major-mode orgtbl-radio-table-templates)]
8580 ["Comment/uncomment table" orgtbl-toggle-comment t])
8582 ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="]
8583 ["Set Field Formula" (org-table-eval-formula '(4)) :active (org-at-table-p) :keys "C-u C-c ="]
8584 ["Edit Formulas" org-table-edit-formulas :active (org-at-table-p) :keys "C-c '"]
8585 ["Recalculate line" org-table-recalculate :active (org-at-table-p) :keys "C-c *"]
8586 ["Recalculate all" (org-table-recalculate '(4)) :active (org-at-table-p) :keys "C-u C-c *"]
8587 ["Iterate all" (org-table-recalculate '(16)) :active (org-at-table-p) :keys "C-u C-u C-c *"]
8588 ["Toggle Recalculate Mark" org-table-rotate-recalc-marks :active (org-at-table-p) :keys "C-c #"]
8589 ["Sum Column/Rectangle" org-table-sum
8590 :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
8591 ["Which Column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"]
8593 org-table-toggle-formula-debugger :active (org-at-table-p)
8595 :style toggle :selected org-table-formula-debug]
8597 org-table-toggle-coordinate-overlays :active (org-at-table-p)
8599 :style toggle :selected org-table-overlay-coordinates]
8604 "If the cursor is inside a table, realign the table.
8605 It it is a table to be sent away to a receiver, do it.
8606 With prefix arg, also recompute table."
8617 (org-table-maybe-eval-formula)
8619 (call-interactively 'org-table-recalculate)
8620 (org-table-maybe-recalculate-line))
8621 (call-interactively 'org-table-align)
8622 (orgtbl-send-table 'maybe))
8627 (if (org-at-table-p)
8628 (org-call-with-arg 'org-table-recalculate t))))
8635 (if arg (org-table-edit-field t)
8636 (org-table-justify-field-maybe)
8637 (org-table-next-field)))
8642 (org-table-justify-field-maybe)
8643 (org-table-next-row))
8647 If the cursor is in a table looking at whitespace, the whitespace is
8648 overwritten, and the table is not marked as requiring realignment."
8650 (if (and (org-at-table-p)
8652 (and org-table-auto-blank-field
8660 (org-table-blank-field))
8664 (let (org-table-may-need-update)
8669 (setq org-table-may-need-update t)
8681 (defvar org-table-clean-did-remove-column-1 nil)
8683 (defun orgtbl-send-table (&optional maybe)
8684 "Send a tranformed version of this table to the receiver position.
8686 this table."
8689 (unless (org-at-table-p) (error "Not at a table"))
8691 (when (interactive-p) (org-table-align))
8693 (goto-char (org-table-begin))
8698 (error "Don't know how to transform this table."))))
8706 (org-table-begin) (org-table-end)))
8708 (lines (org-table-clean-before-export lines))
8709 (i0 (if org-table-clean-did-remove-column-1 2 1))
8710 (table (mapcar
8712 (if (string-match org-table-hline-regexp x)
8719 (org-table-last-alignment
8720 (org-remove-by-index (funcall fun org-table-last-alignment)
8722 (org-table-last-column-widths
8723 (org-remove-by-index (funcall fun org-table-last-column-widths)
8728 (setq txt (funcall transform table params))
8734 (error "Don't know where to insert translated table"))
8766 (t (error "Not at an org table")))))
8778 (defun orgtbl-insert-radio-table ()
8779 "Insert a radio table template appropriate for this major mode."
8781 (let* ((e (assq major-mode orgtbl-radio-table-templates))
8784 (unless e (error "No radio table setup defined for %s" major-mode))
8803 (defun orgtbl-to-generic (table params)
8815 :tstart String to start the table. Ignored when :splice is t.
8816 :tend String to end the table. Ignored when :splice is t.
8818 :splice When set to t, return only table body lines, don't wrap
8824 :lstart String to start a new table line.
8825 :lend String to end a table line
8836 Same as above, specific for the header lines in the table.
8847 directly by `orgtbl-send-table'. See manual."
8855 (if (and (not splicep) (listp (car table)) (memq 'hline table))
8863 (while (setq line (pop table))
8895 (defun orgtbl-to-latex (table params)
8903 :splice When set to t, return only table body lines, don't wrap
8919 org-table-last-alignment ""))
8926 (orgtbl-to-generic table (org-combine-plists params2 params))))
8928 (defun orgtbl-to-html (table params)
8935 :splice When set to t, return only table body lines, don't wrap
8936 them into a <table> environment. Default is nil.
8945 (setq html (org-format-org-table-html
8951 table)
8957 (defun orgtbl-to-texinfo (table params)
8965 :splice nil/t When set to t, return only table body lines, don't wrap
8974 :cf \"f1 f2..\" The column fractions for the table. Bye default these
8980 (let* ((total (float (apply '+ org-table-last-column-widths)))
8984 org-table-last-column-widths " ")))
8991 (orgtbl-to-generic table (org-combine-plists params2 params))))
9284 (table
9299 (org-replace-escapes fmt table)))
9931 (t ; make a new indirect buffer for displaying the link
10823 (table (cond
10856 (completion (try-completion pattern table confirm)))
10859 (insert (substring (cdr (assoc (upcase pattern) table))
10872 (if (assoc completion table)
10875 (if (and (equal type :opt) (assoc completion table))
10880 (let ((list (sort (all-completions pattern table confirm)
10922 With C-u prefix arg, use completion to determine the new state.
11025 or DEADLINE times the new date.
11093 "Insert new timestamp with keyword in the line directly after the headline.
11267 (org-highlight-new-match (match-beginning 0) (match-end 0))
11325 (defun org-highlight-new-match (beg end)
11365 (let (current new news have remove)
11375 (setq new (read-char-exclusive))
11376 (cond ((equal new ?\ ) (setq remove t))
11377 ((or (< (upcase new) ?A) (> (upcase new) org-lowest-priority))
11381 (setq new (1- current)))
11383 (setq new (1+ current)))
11385 (setq new (min (max ?A (upcase new)) org-lowest-priority))
11386 (setq news (format "%c" new))
11482 (setq marker (org-agenda-new-marker))
11509 ;; Get a new match request, with completion
11510 (setq org-last-tags-completion-table
11512 org-last-tags-completion-table))
11608 table current-tags inherited-tags ; computed below when needed
11620 ;; Get a new set of tags from the user
11622 (setq table (or org-tag-alist (org-get-buffer-tags))
11623 org-last-tags-completion-table table
11631 (delq nil (mapcar 'cdr table))))
11632 (org-fast-tag-selection current-tags inherited-tags table)
11645 ;; Insert new tags at the correct column
11665 (let (s1 s2 rtn (ctable org-last-tags-completion-table)
11714 (defun org-fast-tag-selection (current inherited table)
11720 Returns the new tags string, or nil to not change the current settings."
11724 table)))
11763 (setq tbl table char ?a cnt 0)
11783 (if (or (rassoc c1 ntable) (rassoc c1 table))
11784 (while (or (rassoc char ntable) (rassoc char table))
11898 "Get a table of all tags used in the buffer, for completion."
12171 (setq org-table-may-need-update t)
12278 If the time range is actually in a table, the result is inserted into the
12322 (when (org-at-table-p)
12333 (if align (org-table-align))
12669 This creates a new overlay and stores it in `org-clock-overlays', so that it
12733 "Create a table containing a report about clocked time.
12738 then the table will be inserted between these lines, replacing whatever
12739 is was there before. If these lines are not in the buffer, the table
12742 :maxlevel The maximum level to be included in the table. Default is 3.
12743 :emphasize t/nil, if levell 1 and level 2 should be bold/italic in the table."
12884 (org-table-align)))
13295 (org-add-props "1 Restrict call to current buffer 0 Restrict call to region or subtree" nil 'face 'org-table)))
13472 (defun org-store-new-agenda-file-list (list)
13473 "Set new value for the agenda file list and save it correcly."
13535 (org-store-new-agenda-file-list (mapcar 'cdr file-alist))
13556 (org-store-new-agenda-file-list files)
13686 (defun org-agenda-new-marker (&optional pos)
13687 "Return a new agenda marker.
13704 (defvar org-agenda-new-buffers nil
13713 ;; Make a new buffer and remember it
13715 (if buf (push buf org-agenda-new-buffers))
13731 (defvar org-category-table nil)
13732 (defun org-get-category-table ()
13733 "Get the table of categories and positions in current buffer."
13743 (if (not org-category-table)
13753 (let ((tbl org-category-table)
13757 (or (cdar tbl) (cdr (nth (1- (length org-category-table))
13758 org-category-table))))))
14127 (setq org-category-table (org-get-category-table))
14147 (insert "Press `C-u r' to search again with new search string\n"))
14295 'org-marker (org-agenda-new-marker (point-at-bol))))
14300 ;; Catch the error if dealing with the new add-to-diary-alist
14389 (setq org-category-table (org-get-category-table))
14480 (setq marker (org-agenda-new-marker (1+ (match-beginning 0)))
14526 (setq marker (org-agenda-new-marker (match-beginning 0))
14546 (setq hdmarker (org-agenda-new-marker)
14596 (setq marker (org-agenda-new-marker (match-beginning 0))
14609 (setq hdmarker (org-agenda-new-marker)
14672 'org-marker (org-agenda-new-marker pos)
14673 'org-hd-marker (org-agenda-new-marker pos1)
14725 'org-marker (org-agenda-new-marker pos)
14726 'org-hd-marker (org-agenda-new-marker pos1)
14758 (setq marker (org-agenda-new-marker (point)))
14762 (setq hdmarker (org-agenda-new-marker (match-end 1)))
14913 new time)
14923 new)
14925 1 (length (car new)) 'face 'org-time-grid (car new))))
14927 (append new list)
14928 (append list new)))))
15108 (org-release-buffers org-agenda-new-buffers)
15109 (setq org-agenda-new-buffers nil)
15540 The new content of the line will be NEWHEAD (as modified by
15544 the new TODO state."
15546 props m pl undone-face done-face finish new dotime cat tags)
15558 new (org-format-agenda-item "x" newhead cat tags dotime 'noprefix)
15564 ((equal new "")
15568 (replace-match new t t)
15727 (org-agenda-show-new-time marker org-last-changed-timestamp))
15735 (defun org-agenda-show-new-time (marker stamp)
15736 "Show new date stamp via text properties."
16302 (:table-of-contents . org-export-with-toc)
16311 (:table-auto-headline . org-export-highlight-first-table-line)
16354 ("toc" . :table-of-contents)
16406 ((and org-export-table-remove-special-lines
16411 ;; a special table line that should be removed
17151 "Insert a new level in ASCII export."
17453 table-open type
17454 table-buffer table-orig-buffer
17757 ;; Close any local lists before inserting a new header line
17774 (if (not table-open)
17775 ;; New table starts
17776 (setq table-open t table-buffer nil table-orig-buffer nil))
17778 (setq table-buffer (cons line table-buffer)
17779 table-orig-buffer (cons origline table-orig-buffer))
17783 (setq table-open nil
17784 table-buffer (nreverse table-buffer)
17785 table-orig-buffer (nreverse table-orig-buffer))
17787 (insert (org-format-table-html table-buffer table-orig-buffer))))
17817 ;; Start new (level of ) list
17835 ;; Empty lines start a new paragraph. If hand-formatted lists
17837 ;; also start a new paragraph.
17852 ;; Close any local lists before inserting a new header line
17893 (defun org-format-table-html (lines olines)
17896 ;; A normal org table
17897 (org-format-org-table-html lines)
17898 ;; Table made by table.el - test for spanning
17913 (org-format-table-table-html lines)
17914 ;; Need to use the code generator in table.el, with the original text.
17915 (org-format-table-table-html-using-table-generate-source olines)))))
17917 (defun org-format-org-table-html (lines &optional splice)
17918 "Format a table into HTML."
17924 (when org-export-table-remove-special-lines
17925 ;; Check if the table has a marking column. If yes remove the
17927 (setq lines (org-table-clean-before-export lines)))
17929 (let ((head (and org-export-highlight-first-table-line
17957 (string-match org-table-number-regexp x))
17966 (unless splice (push "</table>\n" html))
17973 (if (> (/ (float x) nlines) org-table-number-fraction)
17977 (push org-export-html-table-tag html))
17980 (defun org-table-clean-before-export (lines)
17981 "Check if the table has a marking column.
17989 (setq org-table-clean-did-remove-column-1 nil)
17991 (setq org-table-clean-did-remove-column-1 t)
18001 (defun org-fake-empty-table-line (line)
18011 (defun org-format-table-table-html (lines)
18012 "Format a table generated by table.el into HTML.
18013 This conversion does *not* use `table-generate-source' from table.el.
18017 (head org-export-highlight-first-table-line)
18019 (setq html (concat org-export-html-table-tag "\n"))
18050 (setq html (concat html "</table>\n"))
18053 (defun org-format-table-table-html-using-table-generate-source (lines)
18054 "Format a table into html, using `table-generate-source' from table.el.
18057 (require 'table)
18063 (error "Error processing table"))
18064 (table-recognize-table)
18066 (table-generate-source 'html " org-tmp2 ")
18225 "Insert a new level in HTML export.
18306 file ical-file ical-buffer category started org-agenda-new-buffers)
18341 (org-release-buffers org-agenda-new-buffers))))
18353 (org-category-table (org-get-category-table))
18526 ;; And output the new li
18570 (define-key org-mode-map (org-key 'S-return) 'org-table-copy-down)
18596 (define-key org-mode-map "\C-c\C-xc" 'org-table-copy-down)
18654 (define-key org-mode-map "\C-c-" 'org-table-insert-hline)
18659 (define-key org-mode-map "\C-c?" 'org-table-field-info)
18660 (define-key org-mode-map "\C-c " 'org-table-blank-field)
18661 (define-key org-mode-map "\C-c+" 'org-table-sum)
18662 (define-key org-mode-map "\C-c=" 'org-table-eval-formula)
18663 (define-key org-mode-map "\C-c'" 'org-table-edit-formulas)
18664 (define-key org-mode-map "\C-c`" 'org-table-edit-field)
18665 (define-key org-mode-map "\C-c|" 'org-table-create-or-convert-from-region)
18666 (define-key org-mode-map "\C-c*" 'org-table-recalculate)
18667 (define-key org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks)
18668 (define-key org-mode-map "\C-c~" 'org-table-create-with-table.el)
18669 (define-key org-mode-map "\C-c\C-q" 'org-table-wrap-region)
18670 (define-key org-mode-map "\C-c}" 'org-table-toggle-coordinate-overlays)
18671 (define-key org-mode-map "\C-c{" 'org-table-toggle-formula-debugger)
18693 (defsubst org-table-p () (org-at-table-p))
18697 If the cursor is in a table looking at whitespace, the whitespace is
18698 overwritten, and the table is not marked as requiring realignment."
18700 (if (and (org-table-p)
18703 (and org-table-auto-blank-field
18708 (let (org-table-may-need-update) (org-table-blank-field))
18710 (org-table-blank-field)))
18714 (let (org-table-may-need-update)
18719 (setq org-table-may-need-update t)
18725 front of the next \"|\" separator, to keep the table aligned. The table will
18729 (if (and (org-table-p)
18735 (c org-table-may-need-update))
18742 (if noalign (setq org-table-may-need-update c)))
18748 front of the next \"|\" separator, to keep the table aligned. The table will
18752 (if (and (org-table-p)
18759 (c org-table-may-need-update))
18766 (if noalign (setq org-table-may-need-update c)))
18789 (let (new old)
18791 (setq old (pop commands) new (pop commands))
18793 (define-key map (vector 'remap old) new)
18794 (substitute-key-definition old new map global-map)))))
18796 (when (eq org-enable-table-editor 'optimized)
18797 ;; If the user wants maximum table support, we need to hijack
18810 "Global visibility cycling or move to previous table field.
18811 Calls `org-cycle' with argument t, or `org-table-previous-field', depending
18816 ((org-at-table-p) (call-interactively 'org-table-previous-field))
18823 "Promote subtree or delete table column.
18824 Calls `org-promote-subtree' or `org-table-delete-column', depending on context.
18828 ((org-at-table-p) (call-interactively 'org-table-delete-column))
18834 "Demote subtree or insert table column.
18835 Calls `org-demote-subtree' or `org-table-insert-column', depending on context.
18839 ((org-at-table-p) (call-interactively 'org-table-insert-column))
18845 "Move subtree up or kill table row.
18846 Calls `org-move-subtree-up' or `org-table-kill-row' or
18851 ((org-at-table-p) (call-interactively 'org-table-kill-row))
18856 "Move subtree down or insert table row.
18857 Calls `org-move-subtree-down' or `org-table-insert-row' or
18862 ((org-at-table-p) (call-interactively 'org-table-insert-row))
18868 "Promote heading or move table column to left.
18869 Calls `org-do-promote' or `org-table-move-column', depending on context.
18874 ((org-at-table-p) (org-call-with-arg 'org-table-move-column 'left))
18881 "Demote subtree or move table column to right.
18882 Calls `org-do-demote' or `org-table-move-column', depending on context.
18887 ((org-at-table-p) (call-interactively 'org-table-move-column))
18894 "Move subtree up or move table row up.
18895 Calls `org-move-subtree-up' or `org-table-move-row' or
18900 ((org-at-table-p) (org-call-with-arg 'org-table-move-row 'up))
18906 "Move subtree down or move table row down.
18907 Calls `org-move-subtree-down' or `org-table-move-row' or
18912 ((org-at-table-p) (call-interactively 'org-table-move-row))
18955 "Copy region in table or copy current subtree.
18956 Calls `org-table-copy' or `org-copy-subtree', depending on context.
18960 (if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree)))
18963 "Cut region in table or cut current subtree.
18964 Calls `org-table-copy' or `org-cut-subtree', depending on context.
18968 (if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree)))
18971 "Paste rectangular region into table, or past subtree relative to level.
18972 Calls `org-table-paste-rectangle' or `org-paste-subtree', depending on context.
18975 (if (org-at-table-p)
18976 (org-table-paste-rectangle)
18992 - If the cursor is inside a table, realign the table. This command
18993 works even if the automatic table editor has been turned off.
18996 the entire table.
18998 - If the cursor is inside a table created by the table.el package,
18999 activate that table.
19011 (let ((org-enable-table-editor t))
19025 ((org-at-table.el-p)
19026 (require 'table)
19029 (call-interactively 'table-recognize-table))
19030 ((org-at-table-p)
19031 (org-table-maybe-eval-formula)
19033 (call-interactively 'org-table-recalculate)
19034 (org-table-maybe-recalculate-line))
19035 (call-interactively 'org-table-align))
19043 ;; Recalculate the table before this line
19047 (if (org-at-table-p)
19048 (org-call-with-arg 'org-table-recalculate t))))
19061 "Goto next table row or insert a newline.
19062 Calls `org-table-next-row' or `newline', depending on context.
19066 ((org-at-table-p)
19067 (org-table-justify-field-maybe)
19068 (call-interactively 'org-table-next-row))
19072 "Insert a new heading or wrap a region in a table.
19073 Calls `org-insert-heading' or `org-table-wrap-region', depending on context.
19077 ((org-at-table-p)
19078 (call-interactively 'org-table-wrap-region))
19086 ["Align" org-ctrl-c-ctrl-c (org-at-table-p)]
19087 ["Next Field" org-cycle (org-at-table-p)]
19088 ["Previous Field" org-shifttab (org-at-table-p)]
19089 ["Next Row" org-return (org-at-table-p)]
19091 ["Blank Field" org-table-blank-field (org-at-table-p)]
19092 ["Edit Field" org-table-edit-field (org-at-table-p)]
19093 ["Copy Field from Above" org-table-copy-down (org-at-table-p)]
19096 ["Move Column Left" org-metaleft (org-at-table-p)]
19097 ["Move Column Right" org-metaright (org-at-table-p)]
19098 ["Delete Column" org-shiftmetaleft (org-at-table-p)]
19099 ["Insert Column" org-shiftmetaright (org-at-table-p)])
19101 ["Move Row Up" org-metaup (org-at-table-p)]
19102 ["Move Row Down" org-metadown (org-at-table-p)]
19103 ["Delete Row" org-shiftmetaup (org-at-table-p)]
19104 ["Insert Row" org-shiftmetadown (org-at-table-p)]
19105 ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
19107 ["Insert Hline" org-table-insert-hline (org-at-table-p)])
19109 ["Copy Rectangle" org-copy-special (org-at-table-p)]
19110 ["Cut Rectangle" org-cut-special (org-at-table-p)]
19111 ["Paste Rectangle" org-paste-special (org-at-table-p)]
19112 ["Fill Rectangle" org-table-wrap-region (org-at-table-p)])
19115 ["Set Column Formula" org-table-eval-formula (org-at-table-p)]
19116 ["Set Field Formula" (org-table-eval-formula '(4)) :active (org-at-table-p) :keys "C-u C-c ="]
19117 ["Edit Formulas" org-table-edit-formulas (org-at-table-p)]
19119 ["Recalculate line" org-table-recalculate (org-at-table-p)]
19120 ["Recalculate all" (lambda () (interactive) (org-table-recalculate '(4))) :active (org-at-table-p) :keys "C-u C-c *"]
19121 ["Iterate all" (lambda () (interactive) (org-table-recalculate '(16))) :active (org-at-table-p) :keys "C-u C-u C-c *"]
19123 ["Toggle Recalculate Mark" org-table-rotate-recalc-marks (org-at-table-p)]
19125 ["Sum Column/Rectangle" org-table-sum
19126 (or (org-at-table-p) (org-region-active-p))]
19127 ["Which Column?" org-table-current-column (org-at-table-p)])
19129 org-table-toggle-formula-debugger
19130 :style toggle :selected org-table-formula-debug]
19132 org-table-toggle-coordinate-overlays
19133 :style toggle :selected org-table-overlay-coordinates]
19135 ["Create" org-table-create (and (not (org-at-table-p))
19136 org-enable-table-editor)]
19137 ["Convert Region" org-table-convert-region (not (org-at-table-p 'any))]
19138 ["Import from File" org-table-import (not (org-at-table-p))]
19139 ["Export to File" org-table-export (org-at-table-p)]
19141 ["Create/Convert from/to table.el" org-table-create-with-table.el t]))
19147 ["Cycle Global Visibility" org-shifttab (not (org-at-table-p))]
19164 ["Move Subtree Up" org-shiftmetaup (not (org-at-table-p))]
19165 ["Move Subtree Down" org-shiftmetadown (not (org-at-table-p))]
19167 ["Copy Subtree" org-copy-special (not (org-at-table-p))]
19168 ["Cut Subtree" org-cut-special (not (org-at-table-p))]
19169 ["Paste Subtree" org-paste-special (not (org-at-table-p))]
19171 ["Promote Heading" org-metaleft (not (org-at-table-p))]
19172 ["Promote Subtree" org-shiftmetaleft (not (org-at-table-p))]
19173 ["Demote Heading" org-metaright (not (org-at-table-p))]
19174 ["Demote Subtree" org-shiftmetaright (not (org-at-table-p))]
19176 ["Sort Region/Children" org-sort (not (org-at-table-p))]
19243 ["Create clock table" org-clock-report t]
19379 :table in an org-mode table
19380 :table-special on a special filed in a table
19381 :table-table in a table.el table
19390 faces as a help to recognize the following contexts: :table-special, :link,
19418 ((org-at-table-p)
19419 (push (list :table (org-table-begin) (org-table-end)) clist)
19421 (push (list :table-special
19424 ((org-at-table-p 'any)
19425 (push (list :table-table) clist)))
19531 (defun org-replace-escapes (string table)
19539 (while (setq e (pop table))
19596 (if (or org-enable-table-editor org-enable-fixed-width-editor)
19599 (if org-enable-table-editor "|" "")
19613 "Re-align a table, pass through to fill-paragraph if no table."
19614 (let ((table-p (org-at-table-p))
19615 (table.el-p (org-at-table.el-p)))
19617 (table.el-p t) ; skip table.el tables
19618 (table-p (org-table-align) t) ; align org-mode tables
19657 ;; new outline.el. I guess this should be patched into Emacs?