Function: org-table-fedit-finish

org-table-fedit-finish is an interactive and byte-compiled function defined in org-table.el.gz.

Signature

(org-table-fedit-finish &optional ARG)

Documentation

Parse the buffer for formula definitions and install them.

With prefix ARG, apply the new formulas to the table.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
(defun org-table-fedit-finish (&optional arg)
  "Parse the buffer for formula definitions and install them.
With prefix ARG, apply the new formulas to the table."
  (interactive "P")
  (org-table-remove-rectangle-highlight)
  (when org-table-use-standard-references
    (org-table-fedit-convert-buffer 'org-table-convert-refs-to-rc)
    (setq org-table-buffer-is-an nil))
  (let ((pos org-pos)
	(sel-win org-selected-window)
	(source org-table--fedit-source)
	eql)
    (goto-char (point-min))
    (while (re-search-forward
	    "^\\(@[-+I<>0-9.$@]+\\|@?[0-9]+\\|\\$\\([a-zA-Z0-9]+\\|[<>]+\\)\\) *= *\\(.*\\(\n[ \t]+.*$\\)*\\)"
	    nil t)
      (let ((var (match-string 1))
	    (form (org-trim (match-string 3))))
	(unless (equal form "")
	  (while (string-match "[ \t]*\n[ \t]*" form)
	    (setq form (replace-match " " t t form)))
	  (when (assoc var eql)
	    (user-error "Double formulas for %s" var))
	  (push (cons var form) eql))))
    (set-window-configuration org-window-configuration)
    (select-window sel-win)
    (goto-char source)
    (org-table-store-formulas eql)
    (set-marker pos nil)
    (set-marker source nil)
    (kill-buffer "*Edit Formulas*")
    (if arg
	(org-table-recalculate 'all)
      (message "New formulas installed - press C-u C-c C-c to apply."))))