emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-insert-heading
@ 2010-10-15 17:38 Andreas Röhler
  2010-10-16  5:30 ` org-insert-heading Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Andreas Röhler @ 2010-10-15 17:38 UTC (permalink / raw)
  To: emacs-orgmode


Hi,

doku of `org-insert-heading' says:

,----
| If point is not at the beginning, do not split the line,
| but create the new headline after the current line.
`----

which sounds wisely.

Unfortunately function behaves different, splits line
uses it's following part to create the new headline
from, an inconvenience, resp. bug IMHO.

Also tex-info endorses that:

,----
| When this command is used in
| the middle of a line, the line is split and the rest of the line becomes
| the new headline@footnote{If you do not want the line to be split,
| customize the variable
`----

Seems something across anyway.  Suggest to restore/enable the
behaviour of the doku-string. Could send a patch.

Interesting to read the reason for this change/difference anyway, so 
maybe I change my opinion too...

Thanks all


Andreas

--
https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
https://code.launchpad.net/s-x-emacs-werkstatt/

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

* Re: org-insert-heading
  2010-10-15 17:38 org-insert-heading Andreas Röhler
@ 2010-10-16  5:30 ` Carsten Dominik
  2010-10-16  6:14   ` org-insert-heading Andreas Röhler
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2010-10-16  5:30 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-orgmode

Hi Andreas,

On Oct 15, 2010, at 7:38 PM, Andreas Röhler wrote:

>
> Hi,
>
> doku of `org-insert-heading' says:
>
> ,----
> | If point is not at the beginning, do not split the line,
> | but create the new headline after the current line.
> `----
>
> which sounds wisely.

>
> Unfortunately function behaves different, splits line
> uses it's following part to create the new headline
> from, an inconvenience, resp. bug IMHO.
>
> Also tex-info endorses that:
>
> ,----
> | When this command is used in
> | the middle of a line, the line is split and the rest of the line  
> becomes
> | the new headline@footnote{If you do not want the line to be split,
> | customize the variable
> `----
>

In fact, splitting the line is the intended behavior, and there is a  
variable
to change that.

I have updated the docstring of the command.

- Carsten


> Seems something across anyway.  Suggest to restore/enable the
> behaviour of the doku-string. Could send a patch.
>
> Interesting to read the reason for this change/difference anyway, so  
> maybe I change my opinion too...
>
> Thanks all
>
>
> Andreas
>
> --
> https://code.launchpad.net/~a-roehler/python-mode/python-mode- 
> components
> https://code.launchpad.net/s-x-emacs-werkstatt/
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: org-insert-heading
  2010-10-16  5:30 ` org-insert-heading Carsten Dominik
@ 2010-10-16  6:14   ` Andreas Röhler
  0 siblings, 0 replies; 17+ messages in thread
From: Andreas Röhler @ 2010-10-16  6:14 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Am 16.10.2010 07:30, schrieb Carsten Dominik:
> Hi Andreas,
>
> On Oct 15, 2010, at 7:38 PM, Andreas Röhler wrote:
>
>>
>> Hi,
>>
>> doku of `org-insert-heading' says:
>>
>> ,----
>> | If point is not at the beginning, do not split the line,
>> | but create the new headline after the current line.
>> `----
>>
>> which sounds wisely.
>
>>
>> Unfortunately function behaves different, splits line
>> uses it's following part to create the new headline
>> from, an inconvenience, resp. bug IMHO.
>>
>> Also tex-info endorses that:
>>
>> ,----
>> | When this command is used in
>> | the middle of a line, the line is split and the rest of the line
>> becomes
>> | the new headline@footnote{If you do not want the line to be split,
>> | customize the variable
>> `----
>>
>
> In fact, splitting the line is the intended behavior, and there is a
> variable
> to change that.
>
> I have updated the docstring of the command.
>
> - Carsten
>

Hi Carsten,

as far as your time permits, would think it's useful to keep this point
for a style discussion.

For me, that's a classical way Emacs handles things, but it's a 
classical fault too. The reason, why Emacs is censored having a steep 
learning curve, get its rumour being difficult is just here IMHO.

Well, OTOH success of Emacs and org-mode itself are against me.
Finally I use Emacs myself,  so it can't be that grave.

So what's wrong writing programs that way at this point?

I'll leave the answer open for now.
Want to see if I'm the only way raising that concern.
Meanwhile I use the variable....

Cheers


Andreas

--
https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
https://code.launchpad.net/s-x-emacs-werkstatt/






>
>> Seems something across anyway. Suggest to restore/enable the
>> behaviour of the doku-string. Could send a patch.
>>
>> Interesting to read the reason for this change/difference anyway, so
>> maybe I change my opinion too...
>>
>> Thanks all
>>
>>
>> Andreas
>>
>> --
>> https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
>> https://code.launchpad.net/s-x-emacs-werkstatt/
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

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

* org-insert-heading
@ 2013-11-13  1:49 Thomas S. Dye
  2013-11-13  8:58 ` org-insert-heading Bastien
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas S. Dye @ 2013-11-13  1:49 UTC (permalink / raw)
  To: Org-mode

Aloha all,

With the following Org mode file, there is a dead space where
org-insert-heading doesn't do anything. In the following example, if the
point is on either of the empty lines marked [dead space] no heading is
created.

Is this behavior intended?

* Folded heading   ...
[dead space]
[dead space]

* Heading

All the best,
Tom

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com

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

* Re: org-insert-heading
  2013-11-13  1:49 org-insert-heading Thomas S. Dye
@ 2013-11-13  8:58 ` Bastien
  2013-11-13 13:06   ` org-insert-heading Thomas S. Dye
  0 siblings, 1 reply; 17+ messages in thread
From: Bastien @ 2013-11-13  8:58 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org-mode

Hi Thomas,

tsd@tsdye.com (Thomas S. Dye) writes:

> With the following Org mode file, there is a dead space where
> org-insert-heading doesn't do anything. In the following example, if the
> point is on either of the empty lines marked [dead space] no heading is
> created.
>
> Is this behavior intended?

I can't reproduce it... anyone?

-- 
 Bastien

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

* Re: org-insert-heading
  2013-11-13  8:58 ` org-insert-heading Bastien
@ 2013-11-13 13:06   ` Thomas S. Dye
  2013-11-13 14:15     ` org-insert-heading Bastien
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas S. Dye @ 2013-11-13 13:06 UTC (permalink / raw)
  To: Bastien; +Cc: Org-mode

Hi Bastien,

Bastien <bzg@gnu.org> writes:

> Hi Thomas,
>
> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> With the following Org mode file, there is a dead space where
>> org-insert-heading doesn't do anything. In the following example, if the
>> point is on either of the empty lines marked [dead space] no heading is
>> created.
>>
>> Is this behavior intended?
>
> I can't reproduce it... anyone?

I looked more closely and found that the behavior I described happens
when the folded material ends in a list.  If I end the list by adding
some regular text, then I get the expected behavior.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: org-insert-heading
  2013-11-13 13:06   ` org-insert-heading Thomas S. Dye
@ 2013-11-13 14:15     ` Bastien
  2013-11-14 17:46       ` org-insert-heading Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Bastien @ 2013-11-13 14:15 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org-mode

Hi Thomas,

tsd@tsdye.com (Thomas S. Dye) writes:

> I looked more closely and found that the behavior I described happens
> when the folded material ends in a list.  If I end the list by adding
> some regular text, then I get the expected behavior.

Confirmed -- I quickly looked, it seems that `org-in-item-p' should do
a better job when preceeded by invisible text.

-- 
 Bastien

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

* Re: org-insert-heading
  2013-11-13 14:15     ` org-insert-heading Bastien
@ 2013-11-14 17:46       ` Nicolas Goaziou
  2013-11-14 22:53         ` org-insert-heading Bastien
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2013-11-14 17:46 UTC (permalink / raw)
  To: Bastien; +Cc: Org-mode, Thomas S. Dye

Hello,

Bastien <bzg@gnu.org> writes:

> Confirmed -- I quickly looked, it seems that `org-in-item-p' should do
> a better job when preceeded by invisible text.

I need to rewrite this function.

Anyway, I'm not sure what you mean in your last sentence because, as
a low-level function, its results shouldn't be affected by folding
status of the document (I didn't follow the thread closely, though, and
could be off tracks).


Regards,

-- 
Nicolas Goaziou

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

* Re: org-insert-heading
  2013-11-14 17:46       ` org-insert-heading Nicolas Goaziou
@ 2013-11-14 22:53         ` Bastien
  2013-11-15  6:42           ` org-insert-heading Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Bastien @ 2013-11-14 22:53 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode, Thomas S. Dye

Hi Nicolas,

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

>> Confirmed -- I quickly looked, it seems that `org-in-item-p' should do
>> a better job when preceeded by invisible text.
>
> I need to rewrite this function.
>
> Anyway, I'm not sure what you mean in your last sentence because, as
> a low-level function, its results shouldn't be affected by folding
> status of the document (I didn't follow the thread closely, though, and
> could be off tracks).

The problem is this one:

* Folded subtree...

^-{ Point here

then M-x org-insert-heading RET will *not* insert a heading if the
folded subtree is ending with a list, because `org-in-item-p' will
infer point is within a list.

So maybe `org-insert-heading' should be fixed instead, as a higher
level function, ignoring the folded content before the point?

-- 
 Bastien

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

* Re: org-insert-heading
  2013-11-14 22:53         ` org-insert-heading Bastien
@ 2013-11-15  6:42           ` Carsten Dominik
  2013-11-15  8:08             ` org-insert-heading Bastien
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2013-11-15  6:42 UTC (permalink / raw)
  To: Bastien; +Cc: Org-mode, Nicolas Goaziou, Thomas S. Dye


On 14.11.2013, at 23:53, Bastien <bzg@gnu.org> wrote:

> Hi Nicolas,
> 
> Nicolas Goaziou <n.goaziou@gmail.com> writes:
> 
>>> Confirmed -- I quickly looked, it seems that `org-in-item-p' should do
>>> a better job when preceeded by invisible text.
>> 
>> I need to rewrite this function.
>> 
>> Anyway, I'm not sure what you mean in your last sentence because, as
>> a low-level function, its results shouldn't be affected by folding
>> status of the document (I didn't follow the thread closely, though, and
>> could be off tracks).
> 
> The problem is this one:
> 
> * Folded subtree...
> 
> ^-{ Point here
> 
> then M-x org-insert-heading RET will *not* insert a heading if the
> folded subtree is ending with a list, because `org-in-item-p' will
> infer point is within a list.


I think it is dangerous to change the behavior in such a way that
it will depend on the heading being folded or not.  Definitely org-in-item-p
should not depend on that.  I am still debating with myself if org-insert-heading
should.  Maybe only in interactive use or something like that.  Dangerous territory.

- Carsten

> 
> So maybe `org-insert-heading' should be fixed instead, as a higher
> level function, ignoring the folded content before the point?
> 
> -- 
> Bastien
> 

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

* Re: org-insert-heading
  2013-11-15  6:42           ` org-insert-heading Carsten Dominik
@ 2013-11-15  8:08             ` Bastien
  0 siblings, 0 replies; 17+ messages in thread
From: Bastien @ 2013-11-15  8:08 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Nicolas Goaziou, Org-mode, Thomas S. Dye

Hi Carsten,

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

> I think it is dangerous to change the behavior in such a way that
> it will depend on the heading being folded or not.  Definitely org-in-item-p
> should not depend on that.  I am still debating with myself if org-insert-heading
> should.  Maybe only in interactive use or something like that.
> Dangerous territory.

My rather simple take on this is that org-insert-heading should ignore
the context (like a list) when it's invisible, at least interactively.

2 cents of course,

-- 
 Bastien

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

* org-insert-heading
@ 2014-11-12  0:10 Luke Crook
  2014-11-12  0:13 ` org-insert-heading Luke Crook
  2014-11-13 20:01 ` org-insert-heading Nicolas Goaziou
  0 siblings, 2 replies; 17+ messages in thread
From: Luke Crook @ 2014-11-12  0:10 UTC (permalink / raw)
  To: emacs-orgmode

Question concerning the behaviour of org-insert-heading;

The manual states the following.
>>
If the command is used at the end of a folded subtree (i.e., behind the 
ellipses at the end of a headline), then a headline will be inserted after 
the end of the subtree.
<<

However at least in my installation (Emacs 34.3, org-mode 8.2.10), the new 
heading is created prior to the ellipses.

For example

* Heading folded...

                ^ cursor here, then M-<RET> results in the following.

* Heading folded
* ...

  ^ cursor here

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

* Re: org-insert-heading
  2014-11-12  0:10 org-insert-heading Luke Crook
@ 2014-11-12  0:13 ` Luke Crook
  2014-11-13 20:01 ` org-insert-heading Nicolas Goaziou
  1 sibling, 0 replies; 17+ messages in thread
From: Luke Crook @ 2014-11-12  0:13 UTC (permalink / raw)
  To: emacs-orgmode

Luke Crook <luke <at> balooga.com> writes:

> However at least in my installation (Emacs 34.3, org-mode 8.2.10),

Emacs 24.3 obviously.

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

* Re: org-insert-heading
  2014-11-12  0:10 org-insert-heading Luke Crook
  2014-11-12  0:13 ` org-insert-heading Luke Crook
@ 2014-11-13 20:01 ` Nicolas Goaziou
  2014-11-14  3:14   ` org-insert-heading Luke Crook
  1 sibling, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2014-11-13 20:01 UTC (permalink / raw)
  To: Luke Crook; +Cc: emacs-orgmode

Hello,

Luke Crook <luke@balooga.com> writes:

> Question concerning the behaviour of org-insert-heading;
>
> The manual states the following.
>>>
> If the command is used at the end of a folded subtree (i.e., behind the 
> ellipses at the end of a headline), then a headline will be inserted after 
> the end of the subtree.
> <<
>
> However at least in my installation (Emacs 34.3, org-mode 8.2.10), the new 
> heading is created prior to the ellipses.
>
> For example
>
> * Heading folded...
>
>                 ^ cursor here, then M-<RET> results in the following.

Point is /before/ the ellipses here. You need to move after them, e.g.,
using C-f or mess with `org-special-ctrl-a/e'.


Regards,

-- 
Nicolas Goaziou

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

* Re: org-insert-heading
  2014-11-13 20:01 ` org-insert-heading Nicolas Goaziou
@ 2014-11-14  3:14   ` Luke Crook
  2014-11-14  4:18     ` org-insert-heading Luke Crook
  2014-11-16 14:52     ` org-insert-heading Nicolas Goaziou
  0 siblings, 2 replies; 17+ messages in thread
From: Luke Crook @ 2014-11-14  3:14 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail <at> nicolasgoaziou.fr> writes:

> 
> Point is /before/ the ellipses here. You need to move after them, 
e.g.,
> using C-f or mess with `org-special-ctrl-a/e'.
> 
> Regards,
> 

OK thanks. I understood "behind the ellipses at the end of a headline" 
as "before" the ellipses, not "after".

But I still don't think it works as it is meant to.

Org creates a new list item in the folded heading if the last line is a 
list item.  Otherwise org creates a new heading at the same level as the 
folded heading.

So 

* TEST<cursor here, then M-enter>
- skfjdskjfs

gives the following

* TEST
* <cursor here>
- skfjdskjfs

But

* Test...<cursor here, then M-enter>

gives the following

* TEST
- skfjdskjfs
- <cursor here>

Also the following won't create a new header or list item at all.

* TEST...
<cursor here, then M-enter>

Doesn't do anything

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

* Re: org-insert-heading
  2014-11-14  3:14   ` org-insert-heading Luke Crook
@ 2014-11-14  4:18     ` Luke Crook
  2014-11-16 14:52     ` org-insert-heading Nicolas Goaziou
  1 sibling, 0 replies; 17+ messages in thread
From: Luke Crook @ 2014-11-14  4:18 UTC (permalink / raw)
  To: emacs-orgmode

Luke Crook <luke <at> balooga.com> writes:

> 
> * TEST...
> <cursor here, then M-enter>
> 
> Doesn't do anything
> 

The above I cannot consistently reproduce.  So ignore for now.

Thanks.

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

* Re: org-insert-heading
  2014-11-14  3:14   ` org-insert-heading Luke Crook
  2014-11-14  4:18     ` org-insert-heading Luke Crook
@ 2014-11-16 14:52     ` Nicolas Goaziou
  1 sibling, 0 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2014-11-16 14:52 UTC (permalink / raw)
  To: Luke Crook; +Cc: emacs-orgmode

Luke Crook <luke@balooga.com> writes:

> But I still don't think it works as it is meant to.
>
> Org creates a new list item in the folded heading if the last line is a 
> list item.  Otherwise org creates a new heading at the same level as the 
> folded heading.
>
> So 
>
> * TEST<cursor here, then M-enter>
> - skfjdskjfs
>
> gives the following
>
> * TEST
> * <cursor here>
> - skfjdskjfs
>
> But
>
> * Test...<cursor here, then M-enter>
>
> gives the following
>
> * TEST
> - skfjdskjfs
> - <cursor here>
>
> Also the following won't create a new header or list item at all.
>
> * TEST...
> <cursor here, then M-enter>
>
> Doesn't do anything

This should be fixed. Thank you.


Regards,

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

end of thread, other threads:[~2014-11-16 14:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-15 17:38 org-insert-heading Andreas Röhler
2010-10-16  5:30 ` org-insert-heading Carsten Dominik
2010-10-16  6:14   ` org-insert-heading Andreas Röhler
  -- strict thread matches above, loose matches on Subject: below --
2013-11-13  1:49 org-insert-heading Thomas S. Dye
2013-11-13  8:58 ` org-insert-heading Bastien
2013-11-13 13:06   ` org-insert-heading Thomas S. Dye
2013-11-13 14:15     ` org-insert-heading Bastien
2013-11-14 17:46       ` org-insert-heading Nicolas Goaziou
2013-11-14 22:53         ` org-insert-heading Bastien
2013-11-15  6:42           ` org-insert-heading Carsten Dominik
2013-11-15  8:08             ` org-insert-heading Bastien
2014-11-12  0:10 org-insert-heading Luke Crook
2014-11-12  0:13 ` org-insert-heading Luke Crook
2014-11-13 20:01 ` org-insert-heading Nicolas Goaziou
2014-11-14  3:14   ` org-insert-heading Luke Crook
2014-11-14  4:18     ` org-insert-heading Luke Crook
2014-11-16 14:52     ` org-insert-heading 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).