emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* manipulating org-tables as matrices - operations on org-table in diagonal direction for columns and rows
@ 2014-05-13 22:23 Daniel Kiertscher
  2014-05-21 13:47 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Kiertscher @ 2014-05-13 22:23 UTC (permalink / raw)
  To: emacs-orgmode

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)
; ...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-21 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13 22:23 manipulating org-tables as matrices - operations on org-table in diagonal direction for columns and rows Daniel Kiertscher
2014-05-21 13:47 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).