Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-27 Thread Bastien
Hi Trevor,

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

Trevor Vartanoff t...@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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-26 Thread Trevor Vartanoff

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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-26 Thread Jonathan Leech-Pepin
Hello Trevor,

On 26 September 2012 19:18, Trevor Vartanoff t...@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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-26 Thread Trevor Vartanoff

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.





Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-23 Thread Nicolas Goaziou
Hello,

Trevor Vartanoff t...@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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-23 Thread Nicolas Goaziou
Hello,

Bastien b...@altern.org writes:

 Hi Anthony,

 Anthony Lander anth...@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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-23 Thread Bastien
Hi Nicolas,

Nicolas Goaziou n.goaz...@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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-23 Thread Carsten Dominik

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

 Hello,
 
 Bastien b...@altern.org writes:
 
 Hi Anthony,
 
 Anthony Lander anth...@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
 




Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-23 Thread Nicolas Goaziou
Hello,

Carsten Dominik carsten.domi...@gmail.com writes:

 node-property is another possibility.

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


Regards,

-- 
Nicolas Goaziou



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-23 Thread Bastien
Nicolas Goaziou n.goaz...@gmail.com writes:

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

Fantastic, thanks!

-- 
 Bastien



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-23 Thread Anthony Lander
Hi Bastien,

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

 Hi Anthony,
 
 Anthony Lander anth...@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


Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-22 Thread Bastien
Hi Anthony,

Anthony Lander anth...@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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-20 Thread Trevor Vartanoff

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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-19 Thread Bastien
Hi Trevor,

Trevor Vartanoff t...@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



Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-19 Thread Trevor Vartanoff
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.




Re: [O] org-metaup / org-metadown nerfed in 7.9.1

2012-09-19 Thread Anthony Lander
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)))