emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* reverse column or row.
@ 2013-10-24 12:40 Uwe Brauer
  2013-10-24 20:52 ` Michael Brand
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2013-10-24 12:40 UTC (permalink / raw)
  To: emacs-orgmode

Hello

I think that one could "solve" the hebrew problem I mentioned yesterday,
if there were a function like org-table-reverse-column
(or org-table-reverse-row)
acting like reverse-region but just for columns or rows.

Unfortunately there is no function as reverse-rectangle or something
like this to start with.

Anybody has an idea?

Thanks 


Uwe Brauer 

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

* Re: reverse column or row.
  2013-10-24 12:40 reverse column or row Uwe Brauer
@ 2013-10-24 20:52 ` Michael Brand
  2013-10-25  9:29   ` Uwe Brauer
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2013-10-24 20:52 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: Org Mode

Hi Uwe

On Thu, Oct 24, 2013 at 2:40 PM, Uwe Brauer <oub@mat.ucm.es> wrote:
> I think that one could "solve" the hebrew problem I mentioned yesterday,
> if there were a function like org-table-reverse-column
> (or org-table-reverse-row)
> acting like reverse-region but just for columns or rows.
>
> Unfortunately there is no function as reverse-rectangle or something
> like this to start with.
>
> Anybody has an idea?

This again I see in the category of "fun with combinations of
reverse-region (to reverse lines) and org-table-transpose-table":

Reverse row(s): Isolate the row(s) by adding an empty line before and
after, transpose, reverse, transpose, remove added empty lines.

Reverse column(s): Transpose the whole table before and after the
steps above.

Michael

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

* Re: reverse column or row.
  2013-10-24 20:52 ` Michael Brand
@ 2013-10-25  9:29   ` Uwe Brauer
  2013-10-25 10:59     ` Michael Brand
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2013-10-25  9:29 UTC (permalink / raw)
  To: emacs-orgmode

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

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


   >> 
   >> Anybody has an idea?

   > This again I see in the category of "fun with combinations of
   > reverse-region (to reverse lines) and org-table-transpose-table":


Maybe. 
   > Reverse row(s): Isolate the row(s) by adding an empty line before and
   > after, transpose, reverse, transpose, remove added empty lines.


Aha by empty lines you really mean empty lines, not empty table lines?

That indeed works!
I transposed the table, kill the rectangular with the column I wanted to
reverse, yanked it and then applied reverse-region. Your idea is much
better.

To wrap it into a function seems not that trivial. However a
keyboard macro works just fine and is the poor's man solution to it.

Thanks.

Uwe 

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

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

* Re: reverse column or row.
  2013-10-25  9:29   ` Uwe Brauer
@ 2013-10-25 10:59     ` Michael Brand
  2013-10-25 13:00       ` function (was: reverse column or row.) Uwe Brauer
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2013-10-25 10:59 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: Org Mode

Hi Uwe

On Fri, Oct 25, 2013 at 11:29 AM, Uwe Brauer <oub@mat.ucm.es> wrote:
> Aha by empty lines you really mean empty lines,

Yes,

> not empty table lines?

no.

Michael

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

* function (was: reverse column or row.)
  2013-10-25 10:59     ` Michael Brand
@ 2013-10-25 13:00       ` Uwe Brauer
  0 siblings, 0 replies; 5+ messages in thread
From: Uwe Brauer @ 2013-10-25 13:00 UTC (permalink / raw)
  To: emacs-orgmode

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

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

Here is a function but it just works for one row, if anybody wants to
generalise it for more rows.......


(defun my-org-table-reverse-cells-in-row ()
  "Simple function to reverse cells in one row."
  (interactive)
  (save-excursion
	(end-of-line 1)
	(newline 1)
	(goto-char (org-table-begin))
	(org-table-transpose-table-at-point)
	(let*	  ((beg (org-table-begin))
			   (end (org-table-end)))
	  (goto-char beg)
	  (reverse-region beg end))
	(org-table-transpose-table-at-point)
	(kill-line nil)))


Uwe 

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

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

end of thread, other threads:[~2013-10-25 13:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-24 12:40 reverse column or row Uwe Brauer
2013-10-24 20:52 ` Michael Brand
2013-10-25  9:29   ` Uwe Brauer
2013-10-25 10:59     ` Michael Brand
2013-10-25 13:00       ` function (was: reverse column or row.) Uwe Brauer

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