diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org index bcf7e539d..30d924bd7 100644 --- a/ORGWEBPAGE/Changes.org +++ b/ORGWEBPAGE/Changes.org @@ -32,6 +32,8 @@ ** Details +*** Prefix arg 0 to S-RET disabled integer increment during copy + This was a request by Chris Randle. *** Column view capture tables can have formulas and plotting instructions If you attach formulas and plotting instructions to a table capturing column view, these extra lines will now survive an diff --git a/doc/org.texi b/doc/org.texi index d9a5ad711..575f75d08 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -1541,12 +1541,12 @@ be inserted with @kbd{C-y}. @c @kindex S-@key{RET} @item S-@key{RET} -When current field is empty, copy from first non-empty field above. -When not empty, copy current field down to next row and move cursor -along with it. Depending on the variable -@code{org-table-copy-increment}, integer field values will be -incremented during copy. This key is also used by CUA mode -(@pxref{Cooperation}). +When current field is empty, copy from first non-empty field above. When not +empty, copy current field down to next row and move cursor along with it. +Depending on the variable @code{org-table-copy-increment}, integer field +values will be incremented during copy. Integers that are too large will not +be incremented. Also, a @code{0} prefix argument temporarily dispables the +increment. This key is also used by CUA mode (@pxref{Cooperation}). @tsubheading{Miscellaneous} @kindex C-c ` diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 09db1974d..2ee74e440 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-09-08 Carsten Dominik + + * org-table.el (org-table-copy-down): Avoid overflow during + increment. Use prefix argument 0 to temporarily disable the + increment. + 2008-09-07 Carsten Dominik * org-exp.el (org-export-as-html): Do not turn on the major mode diff --git a/lisp/org-table.el b/lisp/org-table.el index 5d72aab78..db88f79fc 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -865,6 +865,7 @@ in order to easily repeat the interval." (field (org-table-get-field)) (non-empty (string-match "[^ \t]" field)) (beg (org-table-begin)) + (orig-n n) txt) (org-table-check-inside-data-field) (if non-empty @@ -881,12 +882,14 @@ in order to easily repeat the interval." (org-table-goto-column colpos t) (if (and (looking-at "|[ \t]*\\([^| \t][^|]*?\\)[ \t]*|") - (= (setq n (1- n)) 0)) + (<= (setq n (1- n)) 0)) (throw 'exit (match-string 1)))))))) (if txt (progn (if (and org-table-copy-increment - (string-match "^[0-9]+$" txt)) + (not (equal orig-n 0)) + (string-match "^[0-9]+$" txt) + (< (string-to-number txt) 100000000)) (setq txt (format "%d" (+ (string-to-number txt) 1)))) (insert txt) (org-move-to-column col)