Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-28 Thread Max Rydahl Andersen
On 23 Feb 2017, at 14:07, Nicolas Goaziou wrote:

> Hello,
>
> "Max Rydahl Andersen"  writes:
>
>> Here is a screencast of me trying before and after evaluating buffer
>> with the function in it.
>>
>> https://v.usetapes.com/COVDzfByN0
>
> Odd. I definitely see TRT in my case.
>
> What is the value of `org-shiftmetaleft-hook' ? Could you try in
> a minimal environment to check if nothing interferes with the function
> (e.g., `org-autolist')?
>
> If that fails, could you debug `my-shiftmetaleft' and see if it is
> called at all?

Gah - my brain was wired wrong. I tried to use meta-left, not shift-meta-left.

Now it is working - thanks :)

/max
http://about.me/maxandersen



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-23 Thread Nicolas Goaziou
Hello,

"Max Rydahl Andersen"  writes:

> Here is a screencast of me trying before and after evaluating buffer
> with the function in it.
>
> https://v.usetapes.com/COVDzfByN0

Odd. I definitely see TRT in my case. 

What is the value of `org-shiftmetaleft-hook' ? Could you try in
a minimal environment to check if nothing interferes with the function
(e.g., `org-autolist')? 

If that fails, could you debug `my-shiftmetaleft' and see if it is
called at all?

Regards,

-- 
Nicolas Goaziou



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-23 Thread Max Rydahl Andersen

On 23 Feb 2017, at 12:41, Nicolas Goaziou wrote:


Hello,

"Max Rydahl Andersen"  writes:


Fixed the typo - but still nothing happens :/


"Nothing happens" is a bit vague. M-S-Left should demote an item. When
it reaches top-level, it should be turned into a headline. What 
happens

instead?


The same as before, i.e. I observe no difference.

Here is a screencast of me trying before and after evaluating buffer 
with the function in it.


https://v.usetapes.com/COVDzfByN0

/max
http://about.me/maxandersen



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-23 Thread Nicolas Goaziou
Hello,

"Max Rydahl Andersen"  writes:

> Fixed the typo - but still nothing happens :/

"Nothing happens" is a bit vague. M-S-Left should demote an item. When
it reaches top-level, it should be turned into a headline. What happens
instead?

Regards,

-- 
Nicolas Goaziou



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-22 Thread Max Rydahl Andersen
On 22 Feb 2017, at 12:04, Nicolas Goaziou wrote:

> Hello,
>
> "Max Rydahl Andersen"  writes:
>
>> What am I doing wrong ?
>
> Nothing. There is a typo in my code.

Fixed the typo - but still nothing happens :/

/max

>
>> (add-hook 'org-shiftmetaleft-hook
>>(lambda ()
>>  (interactive)
>>  (let* ((element (org-element-at-point))
>> (list-parent (org-element-lineage element '(item plain-list) 
>> t)))
>>(when (and list-parent
>>   (= (line-beginning-position)
>>  (org-element-property :post-affiliated element)))
>
> -> (org-element-property :post-affiliated list-parent)
>
>>  (call-interactively
>>   (if (org-element-lineage list-parent '(item)) ;not at top level
>>   #'org-outdent-item-tree
>> #'org-ctrl-c-star))
>>  t
>
> Regards,
>
> -- 
> Nicolas Goaziou0x80A93738


/max
http://about.me/maxandersen



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-22 Thread Nicolas Goaziou
Hello,

"Max Rydahl Andersen"  writes:

> What am I doing wrong ?

Nothing. There is a typo in my code.

> (add-hook 'org-shiftmetaleft-hook
> (lambda ()
>   (interactive)
>   (let* ((element (org-element-at-point))
>  (list-parent (org-element-lineage element '(item plain-list) 
> t)))
> (when (and list-parent
>(= (line-beginning-position)
>   (org-element-property :post-affiliated element)))

-> (org-element-property :post-affiliated list-parent)

>   (call-interactively
>(if (org-element-lineage list-parent '(item)) ;not at top level
>#'org-outdent-item-tree
>  #'org-ctrl-c-star))
>   t

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-21 Thread Max Rydahl Andersen

On 21 Feb 2017, at 18:35, Nicolas Goaziou wrote:


"Max Rydahl Andersen"  writes:


Any pointers on how to do this ?

I tried this but no luck to get hooked in:

```
(defadvice org-fix-list-indent
(around org-list-indent-item-generic)
  "Advise list indention to trigger creation of star instead"
  (message "DO MAGIC!")
  (ad-do-it)
)
```

But with this "DO MAGIC!" does not show up.


The function to advice is `org-shiftmetaleft', not
`org-fix-list-indent'.

Anyway, you can also add something like the following to
`org-shiftmetaleft-hook':

  (defun my-shiftmetaleft ()
(interactive)
(let* ((element (org-element-at-point))
   (list-parent (org-element-lineage element '(item 
plain-list) t)))

  (when (and list-parent
 (= (line-beginning-position)
(org-element-property :post-affiliated element)))
(call-interactively
 (if (org-element-lineage list-parent '(item)) ;not at top 
level

 #'org-outdent-item-tree
   #'org-ctrl-c-star))
t)))


Thanks! I did this but still no effect ;/

What am I doing wrong ?

```
(add-hook 'org-shiftmetaleft-hook
  (lambda ()
(interactive)
(let* ((element (org-element-at-point))
   (list-parent (org-element-lineage element '(item plain-list) 
t)))
  (when (and list-parent
 (= (line-beginning-position)
(org-element-property :post-affiliated element)))
(call-interactively
 (if (org-element-lineage list-parent '(item)) ;not at top level
 #'org-outdent-item-tree
   #'org-ctrl-c-star))
t
```

/max
http://about.me/maxandersen


Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-21 Thread Nicolas Goaziou
"Max Rydahl Andersen"  writes:

> Any pointers on how to do this ?
>
> I tried this but no luck to get hooked in:
>
> ```
> (defadvice org-fix-list-indent
> (around org-list-indent-item-generic)
>   "Advise list indention to trigger creation of star instead"
>   (message "DO MAGIC!")
>   (ad-do-it)
> )
> ```
>
> But with this "DO MAGIC!" does not show up.

The function to advice is `org-shiftmetaleft', not
`org-fix-list-indent'.

Anyway, you can also add something like the following to
`org-shiftmetaleft-hook':

  (defun my-shiftmetaleft ()
(interactive)
(let* ((element (org-element-at-point))
   (list-parent (org-element-lineage element '(item plain-list) t)))
  (when (and list-parent
 (= (line-beginning-position)
(org-element-property :post-affiliated element)))
(call-interactively
 (if (org-element-lineage list-parent '(item)) ;not at top level
 #'org-outdent-item-tree
   #'org-ctrl-c-star))
t)))
  

Regards,



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-21 Thread Max Rydahl Andersen
On 21 Feb 2017, at 8:42, Nicolas Goaziou wrote:

> Hello,
>
> "Max Rydahl Andersen"  writes:
>
>> Might be - but seems it fits very naturally to be able to at least
>> allow to move list items outside its parent.
>>
>> Don't get me wrong - I  like it defaults to stopping, but would prefer
>> it would ask or let me do shift + left + left to override or something
>> similar.
>
> IMO, the current behaviour is the right one.
>
> However, you can advice, e.g., `org-shiftmetaleft' so it catches the
> error and calls `org-ctrl-c-star' instead.

Any pointers on how to do this ?

I tried this but no luck to get hooked in:

```
(defadvice org-fix-list-indent
(around org-list-indent-item-generic)
  "Advise list indention to trigger creation of star instead"
  (message "DO MAGIC!")
  (ad-do-it)
)
```

But with this "DO MAGIC!" does not show up.

/max
http://about.me/maxandersen


Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-20 Thread Nicolas Goaziou
Hello,

"Max Rydahl Andersen"  writes:

> Might be - but seems it fits very naturally to be able to at least
> allow to move list items outside its parent.
>
> Don't get me wrong - I  like it defaults to stopping, but would prefer
> it would ask or let me do shift + left + left to override or something
> similar.

IMO, the current behaviour is the right one.

However, you can advice, e.g., `org-shiftmetaleft' so it catches the
error and calls `org-ctrl-c-star' instead.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-20 Thread Max Rydahl Andersen



* Some important topic
  - idea 1, some notes
  - idea 2, another note
  - idea 3, a third note


Maybe change your approach and use headlines throughout:

* Some important topic
** idea 1
some notes
** idea 2
another note
** idea 3
a third note

?

You can still move these about and pro/de-mote them as required but 
you

can now add task management keywords easily.


I did it this way until I learned about basic lists.

I prefer basic lists because they visually default to be much less 
prominent highlighted.


Thus I prefer the lighter approach by default and only make thins into 
headings when needed.


/max
http://about.me/maxandersen



Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-20 Thread Max Rydahl Andersen

And then I go over these and I use the shift/alt+keys to reorder the
ideas up and down and eventually I would like to do this:

```
* Some important topic
  - idea 1, some notes
  ** TODO idea 2, another note
  - idea 3, a third note
```


What is that? Is "** TODO idea 2, another note" a headline, in which
case it should be at column 0?


Yes sorry, bad indent.


Headlines are different from plain lists. You can use C-c * on second
item to turn it into a headline.


Yes, I know about that one - but I would prefer not having to change to
another set of keys :)

I can do shift arrow left/rigt/up/down for the list item *until* I hit 
the top heading.



You can also move to the beginning of line (C-a), kill word (M-d) and
insert the two stars. It is a longer but maybe more natural, since 
those

are standard text editing keys.


this is what I do know - just more tedious if shift + arrows could ask 
instead of blocking.



I know I can press a short cut to make it a top item, but why can't
I just use the normal standard tree editing keys ?


I'm not sure to understand what "standard tree editing keys" you're
talking about.


shift arrows up/down/left/righit.


AFAIU, you want to turn a structure (a list) into another one (a
headline). There's a command for that, but I don't consider the action
to be a standard editing one.


Yes, but it would be so convenient it would not just block edit and 
require

shifting to completely different keys IMO.


Is there a way to have org-mode ask what kind of thing it should do
when I move the lists "out-of-bounds" instead
of just error out on me ?


IMO, you may be mis-using the tool.


Might be - but seems it fits very naturally to be able to at least allow 
to move list items outside its parent.


Don't get me wrong - I  like it defaults to stopping, but would prefer 
it would ask or let me do shift + left + left to override or something 
similar.



/max
http://about.me/maxandersen


Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-20 Thread Eric S Fraga
On Monday, 20 Feb 2017 at 12:58, Max Rydahl Andersen wrote:
> Hi,
>
> First time poster and recently started using org-mode and so far enjoying it 
> :)
>
> One nag I do have though is how moving of basic lists are handled.
> I constantly bump into "First item of list cannot move without its subtree"
>
> Is there a way to avoid this error and instead be given the option to
> say "Please just move it up to the next level" ?
>
> What I often have is that I during a meeting or brain dump do this:
>
> * Some important topic
>   - idea 1, some notes
>   - idea 2, another note
>   - idea 3, a third note

Maybe change your approach and use headlines throughout:

* Some important topic
** idea 1
some notes
** idea 2
another note
** idea 3
a third note

?

You can still move these about and pro/de-mote them as required but you
can now add task management keywords easily.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.4-242-g2c27b8


signature.asc
Description: PGP signature


Re: [O] avoiding "First item of list cannot move without its subtree"

2017-02-20 Thread Nicolas Goaziou
Hello,

"Max Rydahl Andersen"  writes:

> What I often have is that I during a meeting or brain dump do this:
>
> ```
> * Some important topic
>   - idea 1, some notes
>   - idea 2, another note
>   - idea 3, a third note
> ```

OK.

> And then I go over these and I use the shift/alt+keys to reorder the
> ideas up and down and eventually I would like to do this:
>
> ```
> * Some important topic
>   - idea 1, some notes
>   ** TODO idea 2, another note
>   - idea 3, a third note
> ```

What is that? Is "** TODO idea 2, another note" a headline, in which
case it should be at column 0?

Headlines are different from plain lists. You can use C-c * on second
item to turn it into a headline.

You can also move to the beginning of line (C-a), kill word (M-d) and
insert the two stars. It is a longer but maybe more natural, since those
are standard text editing keys.

> I know I can press a short cut to make it a top item, but why can't
> I just use the normal standard tree editing keys ?

I'm not sure to understand what "standard tree editing keys" you're
talking about.

AFAIU, you want to turn a structure (a list) into another one (a
headline). There's a command for that, but I don't consider the action
to be a standard editing one.

> Is there a way to have org-mode ask what kind of thing it should do
> when I move the lists "out-of-bounds" instead
> of just error out on me ?

IMO, you may be mis-using the tool.

Regards,

-- 
Nicolas Goaziou



[O] avoiding "First item of list cannot move without its subtree"

2017-02-20 Thread Max Rydahl Andersen

Hi,

First time poster and recently started using org-mode and so far 
enjoying it :)


One nag I do have though is how moving of basic lists are handled.
I constantly bump into "First item of list cannot move without its 
subtree"


Is there a way to avoid this error and instead be given the option to 
say "Please just move it up to the next level" ?


What I often have is that I during a meeting or brain dump do this:

```
* Some important topic
  - idea 1, some notes
  - idea 2, another note
  - idea 3, a third note
```

And then I go over these and I use the shift/alt+keys to reorder the 
ideas up and down and eventually I would like to do this:


```
* Some important topic
  - idea 1, some notes
  ** TODO idea 2, another note
  - idea 3, a third note
```

I know I can press a short cut to make it a top item, but why can't I 
just use the normal standard tree editing keys ?


Is there a way to have org-mode ask what kind of thing it should do when 
I move the lists "out-of-bounds" instead

of just error out on me ?

Thank you,
/max
http://about.me/maxandersen