emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug in structmode++?


From: Christopher Schmidt
Subject: Re: [O] Bug in structmode++?
Date: Tue, 7 May 2013 15:31:53 +0100 (BST)

Bastien <address@hidden> writes:
>> orgstruct(++)-mode used to set auto-fill-function to
>> 'org-auto-fill-function.  This behaviour is too intrusive so we
>> removed it.  You either need to indent secondary lines by hand or set
>> auto-fill-function back to org-auto-fill-function.
>
> I don't remember why it was too intrusive, it worked fine for me.

We overwrite the major mode's custom value of auto-fill-function.  This
is not The Right Thing in each and every case.

In message-mode this is not important,

    (defun message-do-auto-fill ()
      "Like `do-auto-fill', but don't fill in message header."
      (unless (message-point-in-header-p)
        (do-auto-fill)))

org-auto-fill-function does not do much harm here.  That is not the case
for most prog modes, though.

You can easily get the old behaviour back by setting auto-fill-function
to org-auto-fill-function after you activate orgstruct{,++}-mode.

>> orgstruct++'s hijacker of org-insert-heading-respect-content did not
>> respect item bodies.  I fixed this in master a few minutes ago.
>
> I just tried with orgstruct-mode and I still have the problem.

orgstruct-mode does not respect item-body context - see this form in
orgstruct-make-binding:

    (org-context-p 'headline 'item
                   ,(when (memq fun
                                '(org-insert-heading
                                  org-insert-heading-respect-content
                                  org-meta-return))
                      '(when orgstruct-is-++
                         'item-body)))

I think that's a feature.

> With orgstruct++-mode, M-RET on the second line of an item inserts an
> item correctly, but there is another problem (also for
> orgstruct-mode): M-RET on the first line of a two-lines item will
> insert the new item in the middle of the item...

So does vanilla org-mode?


Most people use orgstruct{,++}-mode in message-mode, right?  I think it
makes sense to use vanilla org here.  That is, make an indirect buffer
of the message-mode buffer, narrow the buffer to the message body and
set the major mode to org-mode.  This should give one all the power of
Org, including links, footnotes, font-lock and so on, without that
orgstruct-mess.

        Christopher



reply via email to

[Prev in Thread] Current Thread [Next in Thread]