emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* One-keystroke command to move blocks of text up and down
@ 2013-02-24 15:53 Susan Cragin
  2013-02-24 16:16 ` Carsten Dominik
  0 siblings, 1 reply; 10+ messages in thread
From: Susan Cragin @ 2013-02-24 15:53 UTC (permalink / raw)
  To: emacs-orgmode

I use Meta-up-arrow and Meta-down-arrow to move headings in org and entries in spreadsheets. 
Would like to be able to use the same or similar command to move blocks of text up or down. 
The current solution--highlight then kill/yank--is just too slow.
Suggestions?

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

* Re: One-keystroke command to move blocks of text up and down
  2013-02-24 15:53 Susan Cragin
@ 2013-02-24 16:16 ` Carsten Dominik
  2013-02-24 16:21   ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Carsten Dominik @ 2013-02-24 16:16 UTC (permalink / raw)
  To: Susan Cragin; +Cc: emacs-orgmode


On 24.2.2013, at 16:53, Susan Cragin <susancragin@earthlink.net> wrote:

> I use Meta-up-arrow and Meta-down-arrow to move headings in org and entries in spreadsheets. 
> Would like to be able to use the same or similar command to move blocks of text up or down. 
> The current solution--highlight then kill/yank--is just too slow.
> Suggestions?

Hi Susan,

what do you mean by "blocks".  A paragraph?  Does the command

M-x mark-paragraph

select the right amount of text?  If so, you could try the command transpose-paragraphs.

- Carsten

> 
> 
> 
> 

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

* Re: One-keystroke command to move blocks of text up and down
  2013-02-24 16:16 ` Carsten Dominik
@ 2013-02-24 16:21   ` Nicolas Goaziou
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2013-02-24 16:21 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Susan Cragin

Hello,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On 24.2.2013, at 16:53, Susan Cragin <susancragin@earthlink.net> wrote:
>
>> I use Meta-up-arrow and Meta-down-arrow to move headings in org and entries in spreadsheets. 
>> Would like to be able to use the same or similar command to move blocks of text up or down. 
>> The current solution--highlight then kill/yank--is just too slow.
>> Suggestions?
>
> Hi Susan,
>
> what do you mean by "blocks".  A paragraph?  Does the command
>
> M-x mark-paragraph
>
> select the right amount of text?  If so, you could try the command
> transpose-paragraphs.

M-up and M-down also move paragraphs and most blocks (in Org 7.9).
Unfortunately, binding is shadowed when trying to move a src block.


Regards,

-- 
Nicolas Goaziou

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

* Re: One-keystroke command to move blocks of text up and down
@ 2013-02-24 16:48 Susan Cragin
  2013-02-24 18:16 ` Nick Dokos
  2013-02-24 18:19 ` Bastien
  0 siblings, 2 replies; 10+ messages in thread
From: Susan Cragin @ 2013-02-24 16:48 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Emacs-orgmode list




-----Original Message-----
>From: Carsten Dominik <carsten.dominik@gmail.com>
>Sent: Feb 24, 2013 11:16 AM
>To: Susan Cragin <susancragin@earthlink.net>
>Cc: emacs-orgmode@gnu.org
>Subject: Re: [O] One-keystroke command to move blocks of text up and down
>
>
>On 24.2.2013, at 16:53, Susan Cragin <susancragin@earthlink.net> wrote:
>
>> I use Meta-up-arrow and Meta-down-arrow to move headings in org and entries in spreadsheets. 
>> Would like to be able to use the same or similar command to move blocks of text up or down. 
>> The current solution--highlight then kill/yank--is just too slow.
>> Suggestions?
>
>Hi Susan,
>
>what do you mean by "blocks".  A paragraph?  Does the command
>
>M-x mark-paragraph
>
>select the right amount of text?  If so, you could try the command transpose-paragraphs.
>
>- Carsten

No. I have the following example. Each of these sentences is a paragraph because it has a carriage return after it. I need to re-order the sentence/paragraphs into correct order. 

** Journal
This is paragraph three. 
This is paragraph two. 
This is paragraph one. 

** Other Heading

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

* Re: One-keystroke command to move blocks of text up and down
@ 2013-02-24 17:13 Susan Cragin
  2013-02-24 18:09 ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Susan Cragin @ 2013-02-24 17:13 UTC (permalink / raw)
  To: Nicolas Goaziou, Carsten Dominik; +Cc: emacs-orgmode

>M-up and M-down also move paragraphs and most blocks (in Org 7.9).
>Unfortunately, binding is shadowed when trying to move a src block.

When I try that I get these messages:
Cannot drag this element forward. 
Cannot drag this element backward.

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

* Re: One-keystroke command to move blocks of text up and down
  2013-02-24 17:13 One-keystroke command to move blocks of text up and down Susan Cragin
@ 2013-02-24 18:09 ` Bastien
  0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2013-02-24 18:09 UTC (permalink / raw)
  To: Susan Cragin; +Cc: emacs-orgmode, Nicolas Goaziou, Carsten Dominik

Hi Susan,

Susan Cragin <susancragin@earthlink.net> writes:

>>M-up and M-down also move paragraphs and most blocks (in Org 7.9).
>>Unfortunately, binding is shadowed when trying to move a src block.
>
> When I try that I get these messages:
> Cannot drag this element forward. 
> Cannot drag this element backward.

Can you share the file on which you tested this?

If there is only one paragraph under a headline, you cannot move
it up and down, the move is constrained by the structure of the
file.

Check also C-M-t (Control Meta t) to transpose elements and
S-M-<up/down> to move a line up and down (this last command is
structure-agnostic and can be handy sometimes.)

HTH,

-- 
 Bastien

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

* Re: One-keystroke command to move blocks of text up and down
  2013-02-24 16:48 Susan Cragin
@ 2013-02-24 18:16 ` Nick Dokos
  2013-02-24 18:19 ` Bastien
  1 sibling, 0 replies; 10+ messages in thread
From: Nick Dokos @ 2013-02-24 18:16 UTC (permalink / raw)
  To: Susan Cragin; +Cc: Emacs-orgmode list, Carsten Dominik

Susan Cragin <susancragin@earthlink.net> wrote:

> From: Carsten Dominik <carsten.dominik@gmail.com>
> >On 24.2.2013, at 16:53, Susan Cragin <susancragin@earthlink.net> wrote:
> >
> >> I use Meta-up-arrow and Meta-down-arrow to move headings in org and entries in spreadsheets. 
> >> Would like to be able to use the same or similar command to move blocks of text up or down. 
> >> The current solution--highlight then kill/yank--is just too slow.
> >> Suggestions?
> >
> >Hi Susan,
> >
> >what do you mean by "blocks".  A paragraph?  Does the command
> >
> >M-x mark-paragraph
> >
> >select the right amount of text?  If so, you could try the command transpose-paragraphs.
> >
> >- Carsten
> 
> No. I have the following example. Each of these sentences is a
> paragraph because it has a carriage return after it. I need to
> re-order the sentence/paragraphs into correct order.
> 
> ** Journal
> This is paragraph three. 
> This is paragraph two. 
> This is paragraph one. 
> 
> ** Other Heading
> 

That's a "word processor" definition of a paragraph that doesn't really
work with an editor like emacs. It is more likely you will find
paragraph nirvana in emacs if you follow the TeX model where paragraphs
are separated by empty lines.  For example, there are newlines after
each line of this block of text, and an empty line separating it from
the next block of text, so emacs considers each of these blocks a
paragraph: try M-x mark-paragraph and you will see (transient-mark-mode
helps to see the boundaries).

So if you have a second paragraph like this, you can use Carsten's
suggestion of M-x transpose-paragraphs and switch them around (point has
to be somewhere in the first paragraph, including the empty line
separating it from the second for this to work).

If your "paragraphs" are single lines, as in your example, you can use
transpose-lines to move the lines around (bound to C-x C-t).

HTH,
Nick

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

* Re: One-keystroke command to move blocks of text up and down
  2013-02-24 16:48 Susan Cragin
  2013-02-24 18:16 ` Nick Dokos
@ 2013-02-24 18:19 ` Bastien
  1 sibling, 0 replies; 10+ messages in thread
From: Bastien @ 2013-02-24 18:19 UTC (permalink / raw)
  To: Susan Cragin; +Cc: Emacs-orgmode list, Carsten Dominik

Hi Susan,

Susan Cragin <susancragin@earthlink.net> writes:

> No. I have the following example. Each of these sentences is a paragraph
> because it has a carriage return after it. 

That's your definition but that's not what Emacs and Org understand.
By default, a paragraph needs at least two line breaks.

> I need to re-order the
> sentence/paragraphs into correct order.
>
> ** Journal
> This is paragraph three. 
> This is paragraph two. 
> This is paragraph one. 
>
> ** Other Heading

So you need S-M-<up/down> which moves the line at point up/down.

HTH,

-- 
 Bastien

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

* Re: One-keystroke command to move blocks of text up and down
@ 2013-02-24 19:10 Susan Cragin
  2013-02-24 20:23 ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Susan Cragin @ 2013-02-24 19:10 UTC (permalink / raw)
  To: Bastien; +Cc: Nicolas Goaziou, emacs-orgmode, Carsten Dominik

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

>>>M-up and M-down also move paragraphs and most blocks (in Org 7.9).
>>>Unfortunately, binding is shadowed when trying to move a src block.
>>
>> When I try that I get these messages:
>> Cannot drag this element forward. 
>> Cannot drag this element backward.
>
>Can you share the file on which you tested this?

Here is the file. Most elements have been removed. The test was under today's date. 

>If there is only one paragraph under a headline, you cannot move
>it up and down, the move is constrained by the structure of the
>file.
>
>Check also C-M-t (Control Meta t) to transpose elements and
>S-M-<up/down> to move a line up and down (this last command is
>structure-agnostic and can be handy sometimes.)

Hmmm.... 
S-M-<up/down> should be the ticket but doesn't work for me. 
Assume this is SHIFT-ALT (held down together) up arrow. 
Also tried SHIFT-ESC up. 


[-- Attachment #2: temp.org --]
[-- Type: application/octet-stream, Size: 3368 bytes --]

* System
#+STARTUP: indent
#+STARTUP: xclip
** Good commands to know in Emacs
addition: CTL-C + CTL-Y
inline tasks: (require 'org-inlinetask) M-x org-inlinetask-insert-task RET
sort: C-h a org sort RET
transpose: C-x C-t
timestamps:
active C-u C-c .
inactive C-u C-c !
* 2013 AGENDA
* FEB - Calendar
| --Sunday-- | --Monday-- | -Tuesday-- | Wednesday- | -Thursday- | --Friday-- | -Saturday-- |
|------------+------------+------------+------------+------------+------------+-------------|
|            |            |            |            |            |         01 |          02 |
|            |            |            |            |            |            |             |
|------------+------------+------------+------------+------------+------------+-------------|
|         03 |         04 |         05 |         06 |         07 |         08 |          09 |
|     hockey |        BWG |            |    dentist |            |  snowstorm |             |
|------------+------------+------------+------------+------------+------------+-------------|
|         10 |         11 |         12 |         13 |         14 |         15 |          16 |
|            |        BWG |            |    dentist |            |            |             |
|            |            |            |    alt CWS |            |            |             |
|------------+------------+------------+------------+------------+------------+-------------|
|         17 |         18 |         19 |         20 |         21 |         22 |          23 |
|            |    Holiday |    CWS vol |            |            |            |             |
|------------+------------+------------+------------+------------+------------+-------------|
|         24 |         25 |         26 |         27 |         28 |            |             |
|    CWS vol |       ?CWS |            |            |            |            |             |
|------------+------------+------------+------------+------------+------------+-------------|
* Sun, 24 Feb
** Agenda
| Start | Stop | Item                 | Comment               |
|-------+------+----------------------+-----------------------|
|  6:15 |      | Cold Weather Shelter | emergency replacement |
|       |      |                      |                       |
** TODO list
| X | Pr | Task                                         | Start | Stop | Time |
|---+----+----------------------------------------------+-------+------+------|
|   | a2 | journal                                      |       |      |      |
|   | b1 | do Sched C expenses spreadsheet              | 11:00 |      |      |
|   | b2 | do Schedule C                                |       |      |      |
|   | b3 | pay bills                                    |       |      |      |
|   | c  | clean out trunk, wash 1 load shirts and pack |       |      |      |
|   | c  | pack up knitting                             |       |      |      |
| x | a1 | p&s                                          |       |      |      |
| x | c1 | shovel walk once                             |       |      |      |
|   |    |                                              |       |      |      |
|   |    |                                              |       |      |      |
** Journal
Hello this is a test.
This is a test too. 
This is three.
** Notes for tomorrow
Have to finish student papers.


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

* Re: One-keystroke command to move blocks of text up and down
  2013-02-24 19:10 Susan Cragin
@ 2013-02-24 20:23 ` Bastien
  0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2013-02-24 20:23 UTC (permalink / raw)
  To: Susan Cragin; +Cc: emacs-orgmode, Nicolas Goaziou, Carsten Dominik

Hi Susan,

Susan Cragin <susancragin@earthlink.net> writes:

> Hmmm.... 
> S-M-<up/down> should be the ticket but doesn't work for me. 
> Assume this is SHIFT-ALT (held down together) up arrow. 
> Also tried SHIFT-ESC up. 

Yes, this is shift-alt-up/down, but I just fixed it.

If git is installed on your system, please update Org from
cloning the repository:
  
  ~$ cd git/
  ~$ git clone git://orgmode.org/org-mode.git
  ~$ cd org-mode/
  ~$ make

Then add the directory to your load-path as described in
the manual:

  http://orgmode.org/org.html#Installation

Otherwise I'm afraid you'll have to wait till Org is
updated on your system.

HTH,

-- 
 Bastien

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

end of thread, other threads:[~2013-02-24 20:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-24 17:13 One-keystroke command to move blocks of text up and down Susan Cragin
2013-02-24 18:09 ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2013-02-24 19:10 Susan Cragin
2013-02-24 20:23 ` Bastien
2013-02-24 16:48 Susan Cragin
2013-02-24 18:16 ` Nick Dokos
2013-02-24 18:19 ` Bastien
2013-02-24 15:53 Susan Cragin
2013-02-24 16:16 ` Carsten Dominik
2013-02-24 16:21   ` Nicolas Goaziou

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