Hello,
org-tables already support very helpful operations for manipulating the
order of rows and columns. But we could implement some operations based
on the concept of matrices, making org-tables even more usefull for
drafting ideas using matrix layouts.
Maybe you are interested in the operations I am suggesting and can help
me to implement them.
Maybe you have some questions or suggestions, improving or generalising
this approach?
Here are the first sketches of a part of the functions on org-table
which I am missing for quite a while now.
I am not very familiar with development in elisp though.
;; move field in org-table in diagonal direction
(defun org-table-move-field-upleft ()
"Move Point one line up and one char left."
(interactive)
(org-table-move-row-up)
(org-table-move-column-left))
(global-set-key (kbd "C-<f5>") 'org-table-move-field-upleft)
(defun org-table-move-field-downright ()
"Move Point one line up and one char left."
(interactive)
(org-table-move-row-down)
(org-table-move-column-right))
(global-set-key (kbd "C-<f8>") 'org-table-move-field-downright)
(defun org-table-insert-field-with-row-and-column-upleft ()
"Insert a field with row and column at the uper left corner of the
field at point."
(interactive)
(org-table-insert-column)
(org-table-insert-row))
(global-set-key (kbd "C-<f9>")
'org-table-insert-field-with-row-and-column-upleft)
(defun org-table-duplicate-field-with-row-and-column-upleft ()
"Duplicate a field with row and column at the uper left corner of the
field at point."
(interactive)
(org-table-insert-column)
(org-table-insert-row))
(global-set-key (kbd "C-<f10>")
'org-table-duplicate-field-with-row-and-column-upleft)
(defun org-table-delete-field-with-row-and-column ()
"Delete a field with row and column."
(interactive)
(org-table-delete-column)
(org-table-kill-row))
(global-set-key (kbd "C-<f11>") 'org-table-delete-field-with-row-and-column)
;; move point in org-table in diagonal direction
;; The functions org-table-move-point-.. are note working yet.
(defun org-table-move-point-upleft ()
"Move Point one line up and one char left."
(interactive)
(previous-line)
(org-table-previous-field)) ;how to stop if in a corner?
(global-set-key (kbd "C-<f6>") 'org-table-move-point-upleft)
(defun org-table-move-point-downright ()
"Move Point one line up and one char left."
(interactive)
(next-line)
(org-table-next-field)) ;how to stop if in a corner?
(global-set-key (kbd "C-<f7>") 'org-table-move-point-downright)
;; more transformations on org-table as matrix
; (defun org-table-pivot-table)
; ...
; (defun org-table-sort-columns)
; ...