Re: [O] Bug: subtree archiving when Archive is not final headline yields bad visibility [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.2+gg1+12/lisp/org/)]

2017-12-11 Thread Nicolas Goaziou
Allen Li  writes:

> Archiving DOES move point, it's just a question of where it moves
> point to.  It should not be moving point to the archived heading.
> Examples (^ is point):
>
>   * Foo
>   ** A
>   ** ^B
>   ** C
>   ** Archive :ARCHIVE:...
>
> Archiving to a separate file yields:
>
>   * Foo
>   ** A
>   ^** C
>   ** Archive :ARCHIVE:...
>
> Archiving to a subtree yields:
>
>   * Foo
>   ** A
>   ^** C
>   ** Archive :ARCHIVE:...
>
> BUT if the Archive heading isn’t last:
>
>   * Foo
>   ** Archive :ARCHIVE:...
>   ** A
>   ** ^B
>   ** C
>
> Archiving to a separate file yields:
>
>   * Foo
>   ** Archive :ARCHIVE:...
>   ** A
>   ^** C
>
> Archiving to a subtree yields:
>
>   * Foo
>   ** Archive :ARCHIVE:
>   *** B^...
>   ** A
>   ** C

I see. Fixed. Thank you.

Regards,



Re: [O] Bug: subtree archiving when Archive is not final headline yields bad visibility [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.2+gg1+12/lisp/org/)]

2017-12-11 Thread Allen Li
On Mon, Dec 11, 2017 at 6:10 AM, Nicolas Goaziou  wrote:
> Hello,
>
> Allen Li  writes:
>
>> On Wed, Dec 6, 2017 at 12:19 PM, Allen Li  wrote:
>>> (Can reproduce with Org 9.1.3, submitting with emacs -Q)
>>>
>>> Using a file tmp.org:
>>>
>>>   * Foo
>>>   ** Archive :ARCHIVE:
>>>   *** Test
>>>   :PROPERTIES:
>>>   :ARCHIVE_TIME: 2017-12-06 Wed 12:13
>>>   :END:
>>>   ** Bar
>>>
>>> This appears like so with default visibility:
>>>
>>>   * Foo
>>>   ** Archive :ARCHIVE:...
>>>   ** Bar
>>>
>>> Archiving Bar with C-c C-x A yields:
>>>
>>>   * Foo
>>>   ** Archive :ARCHIVE:...
>>>   *** Bar...
>>>
>>> Expected visibility:
>>>
>>>   * Foo
>>>   ** Archive :ARCHIVE:...
>
> AFAICT, the action leaves point on the just archived sub-heading. As
> a consequence, it has to visible.
>
> Your expected visibility means the function should move point. Why would
> that be better than letting it on the headline you just operated on?

Archiving DOES move point, it's just a question of where it moves
point to.  It should not be moving point to the archived heading.
Examples (^ is point):

  * Foo
  ** A
  ** ^B
  ** C
  ** Archive :ARCHIVE:...

Archiving to a separate file yields:

  * Foo
  ** A
  ^** C
  ** Archive :ARCHIVE:...

Archiving to a subtree yields:

  * Foo
  ** A
  ^** C
  ** Archive :ARCHIVE:...

BUT if the Archive heading isn’t last:

  * Foo
  ** Archive :ARCHIVE:...
  ** A
  ** ^B
  ** C

Archiving to a separate file yields:

  * Foo
  ** Archive :ARCHIVE:...
  ** A
  ^** C

Archiving to a subtree yields:

  * Foo
  ** Archive :ARCHIVE:
  *** B^...
  ** A
  ** C

The implementation is painfully inconsistent.



Re: [O] Bug: subtree archiving when Archive is not final headline yields bad visibility [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.2+gg1+12/lisp/org/)]

2017-12-11 Thread Nicolas Goaziou
Hello,

Allen Li  writes:

> On Wed, Dec 6, 2017 at 12:19 PM, Allen Li  wrote:
>> (Can reproduce with Org 9.1.3, submitting with emacs -Q)
>>
>> Using a file tmp.org:
>>
>>   * Foo
>>   ** Archive :ARCHIVE:
>>   *** Test
>>   :PROPERTIES:
>>   :ARCHIVE_TIME: 2017-12-06 Wed 12:13
>>   :END:
>>   ** Bar
>>
>> This appears like so with default visibility:
>>
>>   * Foo
>>   ** Archive :ARCHIVE:...
>>   ** Bar
>>
>> Archiving Bar with C-c C-x A yields:
>>
>>   * Foo
>>   ** Archive :ARCHIVE:...
>>   *** Bar...
>>
>> Expected visibility:
>>
>>   * Foo
>>   ** Archive :ARCHIVE:...

AFAICT, the action leaves point on the just archived sub-heading. As
a consequence, it has to visible.

Your expected visibility means the function should move point. Why would
that be better than letting it on the headline you just operated on?

>> AFAIK, there is no special location in the file for archived subtrees,
>> i.e., there is nothing wrong with
>>
>>   * Some projects
>>   ** Some item...
>>   ** Archive :ARCHIVE:...
>>   ** New entry...
>
> This bug means that the Archive headline's position is significant.

I fail to see how you draw such a conclusion.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: subtree archiving when Archive is not final headline yields bad visibility [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.2+gg1+12/lisp/org/)]

2017-12-07 Thread Allen Li
On Wed, Dec 6, 2017 at 12:19 PM, Allen Li  wrote:
> (Can reproduce with Org 9.1.3, submitting with emacs -Q)
>
> Using a file tmp.org:
>
>   * Foo
>   ** Archive :ARCHIVE:
>   *** Test
>   :PROPERTIES:
>   :ARCHIVE_TIME: 2017-12-06 Wed 12:13
>   :END:
>   ** Bar
>
> This appears like so with default visibility:
>
>   * Foo
>   ** Archive :ARCHIVE:...
>   ** Bar
>
> Archiving Bar with C-c C-x A yields:
>
>   * Foo
>   ** Archive :ARCHIVE:...
>   *** Bar...
>
> Expected visibility:
>
>   * Foo
>   ** Archive :ARCHIVE:...

Actually, this issue is a bit more severe.  point does not get left on
the next headline, which breaks my workflow of recording a macro for
C-c C-x A and tapping F4 many times.

According to 
http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00286.html

> AFAIK, there is no special location in the file for archived subtrees,
> i.e., there is nothing wrong with
>
>   * Some projects
>   ** Some item...
>   ** Archive :ARCHIVE:...
>   ** New entry...

This bug means that the Archive headline's position is significant.



[O] Bug: subtree archiving when Archive is not final headline yields bad visibility [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.2+gg1+12/lisp/org/)]

2017-12-06 Thread Allen Li
(Can reproduce with Org 9.1.3, submitting with emacs -Q)

Using a file tmp.org:

  * Foo
  ** Archive :ARCHIVE:
  *** Test
  :PROPERTIES:
  :ARCHIVE_TIME: 2017-12-06 Wed 12:13
  :END:
  ** Bar

This appears like so with default visibility:

  * Foo
  ** Archive :ARCHIVE:...
  ** Bar

Archiving Bar with C-c C-x A yields:

  * Foo
  ** Archive :ARCHIVE:...
  *** Bar...

Expected visibility:

  * Foo
  ** Archive :ARCHIVE:...

Emacs  : GNU Emacs 25.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version
3.22.11), modified by Debian
Package: Org-mode version 8.2.10 (release_8.2.10 @
/usr/share/emacs/25.2+gg1+12/lisp/org/)