emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] Re: autoloads not working correctly for org-table.el?


From: Eric Abrahamsen
Subject: Re: [O] [PATCH] Re: autoloads not working correctly for org-table.el?
Date: Sun, 22 Mar 2015 21:52:50 +0800
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Eric Abrahamsen <address@hidden> writes:
>
>> If we really want to get all the message-specific stuff refactored into
>> orgstruct++ mode, I guess we could (in the `orgstruct++-mode' function)
>> bind `normal-auto-fill-function' and `adaptive-fill-function' to new
>> functions, which first check for message-mode specific stuff (and any
>> other modes that need to be handled),then delegate to
>> `org-auto-fill-function' and `org-adaptive-fill-function'.
>
> Indeed. There's also `org-fill-paragraph' to purge from Message mode
> stuff.
>
> Ultimately, Orgstruct minor mode could be moved into its own library,
> e.g., "org-struct.el".
>
>> Actually, all `org-auto-fill-function' does is conditionally call
>> `org-adaptive-fill-function', so maybe we could just have one new
>> function, `orgstruct++-auto-fill-function', that does everything.
>
> Probably, yes.
>
>> How does that sound?
>
> It sounds good.

Okay, here's my first attempt at this.

So far as I can tell, it works. By which I mean "it works, but I don't
understand why". I don't have any experience twiddling with the filling
mechanism, and I found it very baffling, but in all my tests so far this
patch does what it is supposed to.

Likely areas of ugliness:

1. I haven't succeeded in merging `orgstruct-auto-fill-function' with
   `orgstruct-adaptive-fill-function', mostly because I don't really
   understand what "adaptive fill" actually means.
2. I have overridden the `org-element-paragraph-separate' altogether,
   rather than adding message-mode stuff to it. And yet, it works okay,
   to wit: the plain list I'm currently typing.
   3. There's almost certainly refactoring that could be done.

Oops, it doesn't work okay after all -- when I hit RET at the end of the
third list item, it indented itself.

So obviously this isn't quite there yet. I'll keep working at it, which
means actually learning how filling works. In the meantime, any code
comments would be appreciated.

Eric

Attachment: 0001-First-stab-at-independent-orgstruct-mode.patch
Description: Text Data


reply via email to

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