[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] function? (was: rotate tables)
From: |
Uwe Brauer |
Subject: |
[O] function? (was: rotate tables) |
Date: |
Mon, 21 Oct 2013 09:41:33 +0200 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) XEmacs/21.5-b32 (linux) |
>> "Michael" == Michael Brand <address@hidden> writes:
> Hi Uwe
> On Sun, Oct 20, 2013 at 10:12 PM, Uwe Brauer <address@hidden> wrote:
>> | 1 | 2 | 3 |
>> | 4 | 3 | 4 |
>>
>> becomes
>>
>> | 4 | 1 |
>> | 3 | 2 |
>> | 4 | 3 |
> 1) mark table
> 2) M-x reverse-region
> 3) with point in the table: M-x org-table-transpose-table-at-point
what's about a small function doing this, like
(defun org-table-rotate-table ()
"Small hack to rotate a table."
(interactive)
(if (or (and (boundp 'zmacs-region-active-p) zmacs-region-active-p)
(and (boundp 'transient-mark-mode) transient-mark-mode
mark-active))
(save-restriction
(save-excursion
(narrow-to-region (point) (mark))
(goto-char (point-min))
(reverse-region (point) (mark))
(org-table-transpose-table-at-point)))))
Or?
(defun org-table-rotating-table (beg end)
"Small hack to rotate a table."
(interactive "r")
(save-excursion
(goto-char beg)
(reverse-region beg end)
(org-table-transpose-table-at-point)))
Uwe
smime.p7s
Description: S/MIME cryptographic signature