emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: function? (was: rotate tables)
Date: Mon, 21 Oct 2013 09:41:33 +0200	[thread overview]
Message-ID: <878uxnax5e.fsf_-_@mat.ucm.es> (raw)
In-Reply-To: CALn3zogbNiADJ0iigvQiRSN3BRTANEDQLsJ0VnbbR4dfNJyW8A@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

>> "Michael" == Michael Brand <michael.ch.brand@gmail.com> writes:

   > Hi Uwe
   > On Sun, Oct 20, 2013 at 10:12 PM, Uwe Brauer <oub@mat.ucm.es> 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 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5556 bytes --]

  parent reply	other threads:[~2013-10-21  7:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-20 20:12 rotate tables Uwe Brauer
2013-10-20 20:24 ` Michael Brand
2013-10-20 20:43   ` Uwe Brauer
2013-10-21  7:41   ` Uwe Brauer [this message]
2013-11-05 16:35     ` function? Bastien
2013-11-06 14:46       ` function? Uwe Brauer
2013-11-06 14:54         ` function? Bastien
2013-11-06 15:28           ` function? Uwe Brauer
2013-11-06 15:32             ` function? Bastien
2013-11-07 10:16           ` function? Uwe Brauer
2013-11-07 13:49             ` function? Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878uxnax5e.fsf_-_@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).