emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-metaup / org-metadown nerfed in 7.9.1
@ 2012-09-18 15:50 Trevor Vartanoff
  2012-09-19  6:43 ` Bastien
  0 siblings, 1 reply; 17+ messages in thread
From: Trevor Vartanoff @ 2012-09-18 15:50 UTC (permalink / raw)
  To: emacs-orgmode

I updated to 7.9.1 from 7.8.11 and was quite surprised to receive nasty 
"Cannot drag element backward" messages when I tried to use org-metaup 
and org-metadown to move text around.

Why was this done? How do I get back to one stroke functionality? I'm 
afraid I'm not properly understanding the release notes or mailing list 
archives.

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-18 15:50 org-metaup / org-metadown nerfed in 7.9.1 Trevor Vartanoff
@ 2012-09-19  6:43 ` Bastien
  0 siblings, 0 replies; 17+ messages in thread
From: Bastien @ 2012-09-19  6:43 UTC (permalink / raw)
  To: Trevor Vartanoff; +Cc: emacs-orgmode

Hi Trevor,

Trevor Vartanoff <tv@codepuzzles.org> writes:

> I updated to 7.9.1 from 7.8.11 and was quite surprised to receive nasty
> "Cannot drag element backward" messages when I tried to use org-metaup and
> org-metadown to move text around.

It is hard to understand the problem without an example.

When did you get the message and why was it not appropriate?

> Why was this done? 

The origin of the org-meta{up/down} feature was to be able to move table
lines one by one.

By a small generalization, org-meta{up/down} also moved lines up/down
outside of tables.

The idea behind the current behavior is to think in terms of elements,
not in terms of lines -- which is good IMHO.  (A line is an element of a 
table, so moving line by line here is the right thing to do.)

> How do I get back to one stroke functionality? I'm
> afraid I'm not properly understanding the release notes or mailing list
> archives.

Please explain the problem a bit more.  Thanks!

-- 
 Bastien

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
@ 2012-09-19 14:44 Trevor Vartanoff
  2012-09-19 14:50 ` Anthony Lander
  2012-09-23  8:20 ` Nicolas Goaziou
  0 siblings, 2 replies; 17+ messages in thread
From: Trevor Vartanoff @ 2012-09-19 14:44 UTC (permalink / raw)
  To: emacs-orgmode

Your explanation is useful. After some more experimenting, it looks like 
7.8.11 accepts a return as the dividing line between "elements", but 
7.9.1 only recognizes them as separate if there's an empty line between 
them.

Example: if I copy the first two lines of your email, I can shift "It is 
hard to understand..." to be after "When did you get the message...", 
but not if I delete the empty line between them.

And so, example 2, I was receiving "cannot drag element 
forward/backward" when I was in a heading with no line breaks. That is, 
a heading where paragraphs are separated with return + indent rather 
than a full line break of return + return.

(Behavior is identical when I start with an empty .emacs, for the record)

I suppose people who only write and handle text with Internet-style line 
breaks between paragraphs won't notice any change. Those who don't will 
either get "cannot" messages, or they will be quite surprised when org 
scans down, down, down for the next line break and ends up shifting 20 
paragraphs as one element.

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-19 14:44 Trevor Vartanoff
@ 2012-09-19 14:50 ` Anthony Lander
  2012-09-22  9:24   ` Bastien
  2012-09-23  8:20 ` Nicolas Goaziou
  1 sibling, 1 reply; 17+ messages in thread
From: Anthony Lander @ 2012-09-19 14:50 UTC (permalink / raw)
  To: Trevor Vartanoff; +Cc: emacs-orgmode Mode

Hi Trevor,

On 12-Sep-19, at 10:44 AM, Trevor Vartanoff wrote:

> And so, example 2, I was receiving "cannot drag element forward/backward" when I was in a heading with no line breaks. That is, a heading where paragraphs are separated with return + indent rather than a full line break of return + return.

I use the M-up/dn behaviour a lot to move property lines up and down. I added some hooks to restore that functionality since property lines aren't recognized as elements. Here's the code. You might be able to adapt it to do what you want.

Hope it helps,

  -Anthony

; Fix M-<up> and M-<down> to move individual lines inside a property drawer
(add-hook 'org-metaup-hook 'my-org-metaup-hook)
(defun my-org-metaup-hook ()
  "When on a property line, use M-<up> to move the line up"
  (when (org-region-active-p) (return nil))

  (let ((element (car (org-element-at-point))))
    (if (eq element 'property-drawer)
        (let* ((position (- (point) (line-beginning-position)))
               (a (save-excursion (move-beginning-of-line 1) (point)))
               (b (save-excursion (move-end-of-line 1) (point)))
               (c (save-excursion (goto-char a)
                                  (move-beginning-of-line 0)))
               (d (save-excursion (goto-char a)
                                  (move-end-of-line 0) (point))))
          (transpose-regions a b c d)
          (goto-char c)
          (forward-char position)
          t)
        nil)))

(add-hook 'org-metadown-hook 'my-org-metadown-hook)
(defun my-org-metadown-hook ()
  "When on a property line, use M-<down> to move the line down"
  (when (org-region-active-p) (return nil))

  (let ((element (car (org-element-at-point))))
    (if (eq element 'property-drawer)
        (let* ((position (- (point) (line-beginning-position)))
               (at-end-of-line (eq (point) (line-end-position)))
               (a (save-excursion (move-beginning-of-line 1)))
               (b (save-excursion (move-end-of-line 1) (point)))
               (c (save-excursion (next-line)
                                  (move-beginning-of-line 1)))
               (d (save-excursion (next-line)
                                  (move-end-of-line 1) (point))))
          (transpose-regions a b c d)
          (move-beginning-of-line 1)
          (if at-end-of-line            ; Strange boundary condition at end of line
              (progn 
                (next-line)             ; Goes to wrong place. So instead just
                (move-end-of-line 1))   ; go to end of line.
              (forward-char position))
          t)
        nil)))

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
@ 2012-09-20 14:29 Trevor Vartanoff
  0 siblings, 0 replies; 17+ messages in thread
From: Trevor Vartanoff @ 2012-09-20 14:29 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: anthony

Thanks Anthony. Looks like that will be helpful if I ever update.

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-19 14:50 ` Anthony Lander
@ 2012-09-22  9:24   ` Bastien
  2012-09-23  8:25     ` Nicolas Goaziou
  2012-09-23 19:51     ` Anthony Lander
  0 siblings, 2 replies; 17+ messages in thread
From: Bastien @ 2012-09-22  9:24 UTC (permalink / raw)
  To: Anthony Lander; +Cc: emacs-orgmode Mode, Trevor Vartanoff

Hi Anthony,

Anthony Lander <anthony@landerfamily.ca> writes:

> I use the M-up/dn behaviour a lot to move property lines up and down.

Maybe each property line could be a new element recognized as such by
org-element.el.  This way org-metaup/down on a property line would move
it up/down.

(Maybe there are some other benefits from having such an element, 
but I'll trust Nicolas on this.)

Nicolas, what do you think?

-- 
 Bastien

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-19 14:44 Trevor Vartanoff
  2012-09-19 14:50 ` Anthony Lander
@ 2012-09-23  8:20 ` Nicolas Goaziou
  1 sibling, 0 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2012-09-23  8:20 UTC (permalink / raw)
  To: Trevor Vartanoff; +Cc: emacs-orgmode

Hello,

Trevor Vartanoff <tv@codepuzzles.org> writes:

> I suppose people who only write and handle text with Internet-style
> line breaks between paragraphs won't notice any change. Those who
> don't will either get "cannot" messages, or they will be quite
> surprised when org scans down, down, down for the next line break and
> ends up shifting 20 paragraphs as one element.

Org has its own definition for a paragraph, which, apparently, doesn't
match yours.

A paragraph ends either at a blank line, at the end of the buffer, or at
the start of another non-paragraph element. In particular, indentation
is unrelated to paragraph boundaries.

Hence, there is no such thing as "20 paragraphs as one element".
A paragraph is always a single element.


Regards,

-- 
Nicolas Goaziou

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-22  9:24   ` Bastien
@ 2012-09-23  8:25     ` Nicolas Goaziou
  2012-09-23  9:39       ` Bastien
  2012-09-23 10:03       ` Carsten Dominik
  2012-09-23 19:51     ` Anthony Lander
  1 sibling, 2 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2012-09-23  8:25 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode Mode, Anthony Lander, Trevor Vartanoff

Hello,

Bastien <bzg@altern.org> writes:

> Hi Anthony,
>
> Anthony Lander <anthony@landerfamily.ca> writes:
>
>> I use the M-up/dn behaviour a lot to move property lines up and down.
>
> Maybe each property line could be a new element recognized as such by
> org-element.el.  This way org-metaup/down on a property line would move
> it up/down.
>
> (Maybe there are some other benefits from having such an element, 
> but I'll trust Nicolas on this.)
>
> Nicolas, what do you think?

I'm fine with this change.

How would that new element be named? `headline-property'? `property'?

Also, do we want this change in 7.9.3? In that case, it may be wise to
delay its release by a couple of days.


Regards,

-- 
Nicolas Goaziou

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-23  8:25     ` Nicolas Goaziou
@ 2012-09-23  9:39       ` Bastien
  2012-09-23 10:03       ` Carsten Dominik
  1 sibling, 0 replies; 17+ messages in thread
From: Bastien @ 2012-09-23  9:39 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Anthony Lander, emacs-orgmode Mode, Trevor Vartanoff

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> How would that new element be named? `headline-property'? `property'?

`property' is fine, unless it is semantically too close to other
elements and/or objects.

> Also, do we want this change in 7.9.3? In that case, it may be wise to
> delay its release by a couple of days.

Having this for Org 8.0 is okay, lets commit this in master.

Thanks!

Ps: the next minor release will be 7.9.2.

-- 
 Bastien

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-23  8:25     ` Nicolas Goaziou
  2012-09-23  9:39       ` Bastien
@ 2012-09-23 10:03       ` Carsten Dominik
  2012-09-23 17:39         ` Nicolas Goaziou
  1 sibling, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2012-09-23 10:03 UTC (permalink / raw)
  To: Nicolas Goaziou
  Cc: Anthony Lander, Bastien, emacs-orgmode Mode, Trevor Vartanoff


On 23.9.2012, at 10:25, Nicolas Goaziou wrote:

> Hello,
> 
> Bastien <bzg@altern.org> writes:
> 
>> Hi Anthony,
>> 
>> Anthony Lander <anthony@landerfamily.ca> writes:
>> 
>>> I use the M-up/dn behaviour a lot to move property lines up and down.
>> 
>> Maybe each property line could be a new element recognized as such by
>> org-element.el.  This way org-metaup/down on a property line would move
>> it up/down.
>> 
>> (Maybe there are some other benefits from having such an element, 
>> but I'll trust Nicolas on this.)
>> 
>> Nicolas, what do you think?
> 
> I'm fine with this change.
> 
> How would that new element be named? `headline-property'? `property'?

node-property is another possibility.

- Carsten

> 
> Also, do we want this change in 7.9.3? In that case, it may be wise to
> delay its release by a couple of days.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou
> 

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-23 10:03       ` Carsten Dominik
@ 2012-09-23 17:39         ` Nicolas Goaziou
  2012-09-23 18:05           ` Bastien
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2012-09-23 17:39 UTC (permalink / raw)
  To: Carsten Dominik
  Cc: Bastien, emacs-orgmode Mode, Anthony Lander, Trevor Vartanoff

Hello,

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

> node-property is another possibility.

There's now a new element type in master: node-property.


Regards,

-- 
Nicolas Goaziou

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-23 17:39         ` Nicolas Goaziou
@ 2012-09-23 18:05           ` Bastien
  0 siblings, 0 replies; 17+ messages in thread
From: Bastien @ 2012-09-23 18:05 UTC (permalink / raw)
  To: Nicolas Goaziou
  Cc: Anthony Lander, emacs-orgmode Mode, Trevor Vartanoff,
	Carsten Dominik

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> There's now a new element type in master: node-property.

Fantastic, thanks!

-- 
 Bastien

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-22  9:24   ` Bastien
  2012-09-23  8:25     ` Nicolas Goaziou
@ 2012-09-23 19:51     ` Anthony Lander
  1 sibling, 0 replies; 17+ messages in thread
From: Anthony Lander @ 2012-09-23 19:51 UTC (permalink / raw)
  To: Bastien; +Cc: Nicolas Goaziou, emacs-orgmode Mode

Hi Bastien,

On 12-Sep-22, at 5:24 AM, Bastien wrote:

> Hi Anthony,
> 
> Anthony Lander <anthony@landerfamily.ca> writes:
> 
>> I use the M-up/dn behaviour a lot to move property lines up and down.
> 
> Maybe each property line could be a new element recognized as such by
> org-element.el.  This way org-metaup/down on a property line would move
> it up/down.

That would be wonderful - and I see that it will be in 8.0! Thank you & Nicolas for that.

 -Anthony

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
@ 2012-09-26 23:18 Trevor Vartanoff
  2012-09-27  1:49 ` Jonathan Leech-Pepin
  2012-09-27  8:18 ` Bastien
  0 siblings, 2 replies; 17+ messages in thread
From: Trevor Vartanoff @ 2012-09-26 23:18 UTC (permalink / raw)
  To: n.goaziou; +Cc: emacs-orgmode

Nicolas,

"Org has its own definition for a paragraph, which, apparently, doesn't 
match yours.

A paragraph ends either at a blank line, at the end of the buffer, or at 
the start of another non-paragraph element. In particular, indentation 
is unrelated to paragraph boundaries."

If your definition of a paragraph excludes every single publication of 
fiction and nonfiction in the history of written language, you may want 
to rethink your definition. I think Charles Dickens knew what a 
paragraph boundary was.

Actually, it's worse than that: even if you agree that everyone using a 
computer should now separate all paragraphs with a blank line, it still 
means that for any form of writing with closely packed separate lines, 
such as song lyrics, poetry, Shakespeare plays, or even basic lists of 
todo items, org-mode no longer lets you shift the lines around.

I propose we implement an org-property value to decide which definition 
of "element" org-metaup should use. I'm glad to see an exception was 
made for node property, but that's only one of many, many problem cases.

Regards,
Trevor Vartanoff

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-26 23:18 Trevor Vartanoff
@ 2012-09-27  1:49 ` Jonathan Leech-Pepin
  2012-09-27  8:18 ` Bastien
  1 sibling, 0 replies; 17+ messages in thread
From: Jonathan Leech-Pepin @ 2012-09-27  1:49 UTC (permalink / raw)
  To: Trevor Vartanoff; +Cc: emacs-orgmode, n.goaziou

Hello Trevor,

On 26 September 2012 19:18, Trevor Vartanoff <tv@codepuzzles.org> wrote:
>
> Nicolas,
>
>
> "Org has its own definition for a paragraph, which, apparently, doesn't
> match yours.
>
> A paragraph ends either at a blank line, at the end of the buffer, or at
> the start of another non-paragraph element. In particular, indentation is
> unrelated to paragraph boundaries."
>
> If your definition of a paragraph excludes every single publication of
> fiction and nonfiction in the history of written language, you may want to
> rethink your definition. I think Charles Dickens knew what a paragraph
> boundary was.

LaTeX uses the same paragraph definition, it splits on blank lines.
So does the old exporter.  By default if there is not a blank line
they treat it as a continuation of the previous.  If you treat it
otherwise how do you tell the difference between a manual break and
wrapped text that went to the next line?

> Actually, it's worse than that: even if you agree that everyone using a
> computer should now separate all paragraphs with a blank line, it still
> means that for any form of writing with closely packed separate lines, such
> as song lyrics, poetry, Shakespeare plays, or even basic lists of todo
> items, org-mode no longer lets you shift the lines around.

Basic lists of todo items will still work fine, Org treats list items
as their own elements and can be moved using org-metaup/down.  It will
also move paragraphs/verses for poetry and theater.  =transpose-lines=
( C-x C-t ) can be used to move the individual lines around
individually.

> I propose we implement an org-property value to decide which definition of
> "element" org-metaup should use. I'm glad to see an exception was made for
> node property, but that's only one of many, many problem cases.
>
> Regards,
> Trevor Vartanoff
>

Regards,
Jon

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
@ 2012-09-27  2:09 Trevor Vartanoff
  0 siblings, 0 replies; 17+ messages in thread
From: Trevor Vartanoff @ 2012-09-27  2:09 UTC (permalink / raw)
  To: jonathan.leechpepin; +Cc: emacs-orgmode, n.goaziou

Jonathan,

I should have been more clear on what I meant by "basic", quite idiotic 
of me and sorry for the confusion.

If you write ten words on ten lines, you can't shift things around 
anymore until you've put everything into an Official Orgmode Endorsed 
Structure of some kind. Sometimes I don't need to bother. Sometimes 
while I'm creating the list, I don't decide until later whether to make 
it headings or list, and I need to be able to shift its items around first.

Org-mode successfully taught me that I can move _everything_ around. 
I've happily adapted to this freedom, and now it wants to take it away. 
So, I apologize for my whining, but to me it it is as unexpected as if I 
updated Emacs and the macros stopped working.

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

* Re: org-metaup / org-metadown nerfed in 7.9.1
  2012-09-26 23:18 Trevor Vartanoff
  2012-09-27  1:49 ` Jonathan Leech-Pepin
@ 2012-09-27  8:18 ` Bastien
  1 sibling, 0 replies; 17+ messages in thread
From: Bastien @ 2012-09-27  8:18 UTC (permalink / raw)
  To: Trevor Vartanoff; +Cc: emacs-orgmode, n.goaziou

Hi Trevor,

let's not invite Charles Dickens and William Shakespeare to this
discussion, I guess they really don't care :)

Trevor Vartanoff <tv@codepuzzles.org> writes:

> I'm glad to see an exception was made for
> node property, but that's only one of many, many problem cases.

We will be able to examinate those problems if you state them
as clearly and concisely as possible, one by one.  Thanks in 
advance for that.

Chances are that Org gave you a certain degree of freedom that
you still have with Emacs in general.  For example, you can still
transpose lines within a paragraph with C-x C-t.

Best,

-- 
 Bastien

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

end of thread, other threads:[~2012-09-27  8:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-18 15:50 org-metaup / org-metadown nerfed in 7.9.1 Trevor Vartanoff
2012-09-19  6:43 ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2012-09-19 14:44 Trevor Vartanoff
2012-09-19 14:50 ` Anthony Lander
2012-09-22  9:24   ` Bastien
2012-09-23  8:25     ` Nicolas Goaziou
2012-09-23  9:39       ` Bastien
2012-09-23 10:03       ` Carsten Dominik
2012-09-23 17:39         ` Nicolas Goaziou
2012-09-23 18:05           ` Bastien
2012-09-23 19:51     ` Anthony Lander
2012-09-23  8:20 ` Nicolas Goaziou
2012-09-20 14:29 Trevor Vartanoff
2012-09-26 23:18 Trevor Vartanoff
2012-09-27  1:49 ` Jonathan Leech-Pepin
2012-09-27  8:18 ` Bastien
2012-09-27  2:09 Trevor Vartanoff

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