(defvar orgtbl-after-send-table-hook nil
"Hook for functions attaching to `C-c C-c', if the table is sent.
This can be used to add additional functionality after the table is sent
-to the receiver position, othewise, if table is not sent, the functions
+to the receiver position, otherwise, if table is not sent, the functions
are not run.")
(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
except maybe locally in a special file that has mostly tables with long
fields."
:group 'org-table
+ :version "24.1"
:type 'boolean)
(defcustom org-table-fix-formulas-confirm nil
"Whether the user should confirm when Org fixes formulas."
:group 'org-table-editing
+ :version "24.1"
:type '(choice
(const :tag "with yes-or-no" yes-or-no-p)
(const :tag "with y-or-n" y-or-n-p)
'days, and the output will be a fraction of seconds, minutes or
days."
:group 'org-table-calculation
+ :version "24.1"
:type '(choice (symbol :tag "Seconds" 'seconds)
(symbol :tag "Minutes" 'minutes)
(symbol :tag "Hours " 'hours)
characters. Beware that modifying the display can prevent the
field from being used in another formula."
:group 'org-table-settings
+ :version "24.1"
:type 'string)
(defcustom org-table-formula-evaluate-inline t
(defun org-table-line-to-dline (line &optional above)
"Turn a buffer line number into a data line number.
If there is no data line in this line, return nil.
-If there is no matchin dline (most likely te refrence was a hline), the
+If there is no matching dline (most likely te reference was a hline), the
first dline below it is used. When ABOVE is non-nil, the one above is used."
(catch 'exit
(let ((ll (length org-table-dlines))
(looking-at org-table-auto-recalculate-regexp))
(org-table-recalculate) t))
-(defvar modes)
+(defvar org-table-modes)
(defsubst org-set-calc-mode (var &optional value)
(if (stringp var)
(setq var (assoc var '(("D" calc-angle-mode deg)
("F" calc-prefer-frac t)
("S" calc-symbolic-mode t)))
value (nth 2 var) var (nth 1 var)))
- (if (memq var modes)
- (setcar (cdr (memq var modes)) value)
- (cons var (cons value modes)))
- modes)
+ (if (memq var org-table-modes)
+ (setcar (cdr (memq var org-table-modes)) value)
+ (cons var (cons value org-table-modes)))
+ org-table-modes)
(defun org-table-eval-formula (&optional arg equation
suppress-align suppress-const
(replace-match
(save-match-data
(org-table-make-reference
- (org-table-get-remote-range
- (match-string 1 form) (match-string 2 form))
+ (let ((rmtrng (org-table-get-remote-range
+ (match-string 1 form) (match-string 2 form))))
+ (if duration
+ (if (listp rmtrng)
+ (mapcar (lambda(x) (org-table-time-string-to-seconds x)) rmtrng)
+ (org-table-time-string-to-seconds rmtrng))
+ rmtrng))
keep-empty numbers lispp))
t t form)))
;; Insert complex ranges
; (setq r2 (or r2 r1) c2 (or c2 c1))
(if (not r1) (setq r1 thisline))
(if (not r2) (setq r2 thisline))
- (if (not c1) (setq c1 col))
- (if (not c2) (setq c2 col))
+ (if (or (not c1) (= 0 c1)) (setq c1 col))
+ (if (or (not c2) (= 0 c2)) (setq c2 col))
(if (and (not corners-only)
(or (not rangep) (and (= r1 r2) (= c1 c2))))
;; just one field
(prog1 (org-trim (org-table-get-field c1))
(if highlight (org-table-highlight-rectangle (point) (point)))))
;; A range, return a vector
- ;; First sort the numbers to get a regular ractangle
+ ;; First sort the numbers to get a regular rectangle
(if (< r2 r1) (setq tmp r1 r1 r2 r2 tmp))
(if (< c2 c1) (setq tmp c1 c1 c2 c2 tmp))
(if corners-only
(defun org-table-iterate (&optional arg)
"Recalculate the table until it does not change anymore.
-The maximun number of iterations is 10, but you can chose a different value
+The maximum number of iterations is 10, but you can choose a different value
with the prefix ARG."
(interactive "P")
(let ((imax (if arg (prefix-numeric-value arg) 10))
(looking-at "[^|\n]* +|"))
(let (org-table-may-need-update)
(goto-char (1- (match-end 0)))
- (delete-char -1)
+ (backward-delete-char 1)
(goto-char (match-beginning 0))
(self-insert-command N))
(setq org-table-may-need-update t)