|
@@ -1813,11 +1813,12 @@ When NAMED is non-nil, look for a named equation."
|
|
|
(setq alist (sort alist 'org-table-formula-less-p))
|
|
|
(save-excursion
|
|
|
(goto-char (org-table-end))
|
|
|
- (if (looking-at "\\([ \t]*\n\\)*#\\+TBLFM:\\(.*\n?\\)")
|
|
|
+ (if (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+TBLFM:\\(.*\n?\\)")
|
|
|
(progn
|
|
|
;; don't overwrite TBLFM, we might use text properties to store stuff
|
|
|
(goto-char (match-beginning 2))
|
|
|
(delete-region (match-beginning 2) (match-end 0)))
|
|
|
+ (org-indent-line-function)
|
|
|
(insert "#+TBLFM:"))
|
|
|
(insert " "
|
|
|
(mapconcat (lambda (x)
|
|
@@ -1846,7 +1847,7 @@ When NAMED is non-nil, look for a named equation."
|
|
|
(let (scol eq eq-alist strings string seen)
|
|
|
(save-excursion
|
|
|
(goto-char (org-table-end))
|
|
|
- (when (looking-at "\\([ \t]*\n\\)*#\\+TBLFM: *\\(.*\\)")
|
|
|
+ (when (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+TBLFM: *\\(.*\\)")
|
|
|
(setq strings (org-split-string (match-string 2) " *:: *"))
|
|
|
(while (setq string (pop strings))
|
|
|
(when (string-match "\\`\\(@[0-9]+\\$[0-9]+\\|\\$\\([a-zA-Z0-9]+\\)\\) *= *\\(.*[^ \t]\\)" string)
|
|
@@ -1871,7 +1872,7 @@ KEY is \"@\" or \"$\". REPLACE is an alist of numbers to replace.
|
|
|
For all numbers larger than LIMIT, shift them by DELTA."
|
|
|
(save-excursion
|
|
|
(goto-char (org-table-end))
|
|
|
- (when (looking-at "#\\+TBLFM:")
|
|
|
+ (when (looking-at "[ \t]*#\\+TBLFM:")
|
|
|
(let ((re (concat key "\\([0-9]+\\)"))
|
|
|
(re2
|
|
|
(when remove
|
|
@@ -2658,7 +2659,7 @@ Parameters get priority."
|
|
|
(defun org-table-edit-formulas ()
|
|
|
"Edit the formulas of the current table in a separate buffer."
|
|
|
(interactive)
|
|
|
- (when (save-excursion (beginning-of-line 1) (looking-at "#\\+TBLFM"))
|
|
|
+ (when (save-excursion (beginning-of-line 1) (looking-at "[ \t]*#\\+TBLFM"))
|
|
|
(beginning-of-line 0))
|
|
|
(unless (org-at-table-p) (error "Not at a table"))
|
|
|
(org-table-get-specials)
|
|
@@ -3537,9 +3538,9 @@ With prefix arg, also recompute table."
|
|
|
(let ((pos (point)) action)
|
|
|
(save-excursion
|
|
|
(beginning-of-line 1)
|
|
|
- (setq action (cond ((looking-at "#\\+ORGTBL:.*\n[ \t]*|") (match-end 0))
|
|
|
+ (setq action (cond ((looking-at "[ \t]*#\\+ORGTBL:.*\n[ \t]*|") (match-end 0))
|
|
|
((looking-at "[ \t]*|") pos)
|
|
|
- ((looking-at "#\\+TBLFM:") 'recalc))))
|
|
|
+ ((looking-at "[ \t]*#\\+TBLFM:") 'recalc))))
|
|
|
(cond
|
|
|
((integerp action)
|
|
|
(goto-char action)
|
|
@@ -3665,7 +3666,7 @@ a radio table."
|
|
|
(goto-char (org-table-begin))
|
|
|
(let (rtn)
|
|
|
(beginning-of-line 0)
|
|
|
- (while (looking-at "#\\+ORGTBL[: \t][ \t]*SEND +\\([a-zA-Z0-9_]+\\) +\\([^ \t\r\n]+\\)\\( +.*\\)?")
|
|
|
+ (while (looking-at "[ \t]*#\\+ORGTBL[: \t][ \t]*SEND +\\([a-zA-Z0-9_]+\\) +\\([^ \t\r\n]+\\)\\( +.*\\)?")
|
|
|
(let ((name (org-no-properties (match-string 1)))
|
|
|
(transform (intern (match-string 2)))
|
|
|
(params (if (match-end 3)
|