From 84d576b029f02f4880bc5c3f4eb9f7dd0609a729 Mon Sep 17 00:00:00 2001 From: Chris Kauffman Date: Tue, 29 May 2018 14:44:26 -0500 Subject: [PATCH 7/8] org-table.el: Added single cell movement * lisp/org-table.el: New functions `org-table-move-single-cell-*' along with supporting internal functions. * doc/org-manual.org: Added documentation associated with single cell movement. --- lisp/org-table.el | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 009f50d19..1c8c97f43 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -1441,21 +1441,6 @@ non-nil, the one above is used." (t (setq min mean))))) (if above min max)))))) -;; replaced with call to org-table-analyze and use of variables set by it - -;; ;;;###autoload -;; (defun org-table-max-line-col () -;; "Return the maximum line and column of the current table as a -;; list of two numbers" -;; (when (not (org-at-table-p)) -;; (user-error "Not in an org-table")) -;; (let ((table-end (org-table-end))) -;; (save-mark-and-excursion -;; (goto-char table-end) -;; (org-table-previous-field) -;; (list (org-table-current-line) (org-table-current-column))))) - -; ;;;###autoload ;; told not to autoload by Nicolas Goaziou (defun org-table--swap-cells (row1 col1 row2 col2) "Swap two cells indicated by the coordinates provided. row1, col1, row2, col2 are integers indicating the row/column @@ -1463,17 +1448,13 @@ position of the two cells that will be swapped in the table." (let ((content1 (org-table-get row1 col1)) (content2 (org-table-get row2 col2))) (org-table-put row1 col1 content2) - (org-table-put row2 col2 content1) -; (org-table-align) ;; told by Nicolas Goaziou that this is "out of scope" - )) + (org-table-put row2 col2 content1))) -; ;;;###autoload ; told not to auto-load by Nicolas Goaziou, also reformatted comment (defun org-table--move-single-cell (direction) "Move the current cell in a cardinal direction. Parameter direction is a symbol which mathes 'up 'down 'left or 'right. The contents the current cell are swapped with cell in the indicated direction." -;removed check for in table; moved to public functions (let ((drow 0) (dcol 0)) (cond ((equal direction 'up) (setq drow -1)) ((equal direction 'down) (setq drow +1)) -- 2.17.0