emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-pop-mode
@ 2020-03-18  2:33 Mark E. Shoulson
  2020-03-18  7:00 ` org-pop-mode Ihor Radchenko
  2020-03-18 19:15 ` org-pop-mode Adam Porter
  0 siblings, 2 replies; 9+ messages in thread
From: Mark E. Shoulson @ 2020-03-18  2:33 UTC (permalink / raw)
  To: org-mode mailing list

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

This is something I've wanted for years in org-mode, but which in some 
ways could actually be _offensive_ to its ideals.  If you're an outline 
purist, look away.


It's something we can do with plain lists: work on a list item at level 
X, then make a sublist at level X+1, and then "pop" back up to the same 
list item you had been working on at level X, without needing a new 
header.  You just adjust the indentation.


   + Some stuff at this level.

   + More stuff at this level.

     Might even have multiple paragraphs.

     - a sublevel, for a digression


     And back to the same higher level, even without a new bullet.


I use org-mode to keep daily notes at work, sometimes almost 
stream-of-consciousness, and often wished I could digress and then pop back.


So, I present a pre-alpha version, 
https://gist.github.com/clsn/09ac4b098b6ad7366bb5e0bc88882d5f of 
org-pop-mode.  To "pop" back up, create a headline at the level you're 
popping back to, and give it a tag of "contd", and the headline text 
should not be something important.  Instructions and explanations are in 
the comments of the file (the part about installing from MELPA is a lie, 
though).


Any feedback?


~mark


[-- Attachment #2: Type: text/html, Size: 2077 bytes --]

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

* Re: org-pop-mode
  2020-03-18  2:33 org-pop-mode Mark E. Shoulson
@ 2020-03-18  7:00 ` Ihor Radchenko
  2020-03-18 19:57   ` org-pop-mode Mark E. Shoulson
  2020-03-22 14:58   ` org-pop-mode Mark E. Shoulson
  2020-03-18 19:15 ` org-pop-mode Adam Porter
  1 sibling, 2 replies; 9+ messages in thread
From: Ihor Radchenko @ 2020-03-18  7:00 UTC (permalink / raw)
  To: Mark E. Shoulson, org-mode mailing list

> Any feedback?

From the first glance it does not look too different from inline
headings. Could you highlight the difference?

Best,
Ihor


"Mark E. Shoulson" <mark@shoulson.com> writes:

> This is something I've wanted for years in org-mode, but which in some 
> ways could actually be _offensive_ to its ideals.  If you're an outline 
> purist, look away.
>
>
> It's something we can do with plain lists: work on a list item at level 
> X, then make a sublist at level X+1, and then "pop" back up to the same 
> list item you had been working on at level X, without needing a new 
> header.  You just adjust the indentation.
>
>
>    + Some stuff at this level.
>
>    + More stuff at this level.
>
>      Might even have multiple paragraphs.
>
>      - a sublevel, for a digression
>
>
>      And back to the same higher level, even without a new bullet.
>
>
> I use org-mode to keep daily notes at work, sometimes almost 
> stream-of-consciousness, and often wished I could digress and then pop back.
>
>
> So, I present a pre-alpha version, 
> https://gist.github.com/clsn/09ac4b098b6ad7366bb5e0bc88882d5f of 
> org-pop-mode.  To "pop" back up, create a headline at the level you're 
> popping back to, and give it a tag of "contd", and the headline text 
> should not be something important.  Instructions and explanations are in 
> the comments of the file (the part about installing from MELPA is a lie, 
> though).
>
>
> Any feedback?
>
>
> ~mark
>

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg

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

* Re: org-pop-mode
  2020-03-18  2:33 org-pop-mode Mark E. Shoulson
  2020-03-18  7:00 ` org-pop-mode Ihor Radchenko
@ 2020-03-18 19:15 ` Adam Porter
  2020-03-18 20:05   ` org-pop-mode Mark E. Shoulson
  1 sibling, 1 reply; 9+ messages in thread
From: Adam Porter @ 2020-03-18 19:15 UTC (permalink / raw)
  To: emacs-orgmode

"Mark E. Shoulson" <mark@shoulson.com> writes:

> This is something I've wanted for years in org-mode, but which in some
> ways could actually be _offensive_ to its ideals.  If you're an
> outline purist, look away.
>
> ...
>
> So, I present a pre-alpha version,
> https://gist.github.com/clsn/09ac4b098b6ad7366bb5e0bc88882d5f of
> org-pop-mode.  To "pop" back up, create a headline at the level you're
> popping back to, and give it a tag of "contd", and the headline text
> should not be something important.  Instructions and explanations are
> in the comments of the file (the part about installing from MELPA is a
> lie, though).
>
> Any feedback?

Hi Mark,

Indeed, this is something that is frequently asked about.  I probably
wouldn't use it myself, but it looks like you've done a good job on it.
Here is some feedback:

1.  I'd suggest a more descriptive name, especially if you plan to
publish it to MELPA.  org-pop doesn't seem to convey anything about what
it does.  :)

2.  In the code, I saw you comment about cl-flet, and I see you using
fset and unwind-protect in the org-pop-with-continuations macro.
Instead, use cl-letf with symbol-function, like:

  (cl-letf* (((symbol-function 'foo)
              #'my-foo)
             ((symbol-function 'bar)
              (lambda ()
                ...)))
    BODY)

See also Nic Ferrier's package, noflet.

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

* Re: org-pop-mode
  2020-03-18  7:00 ` org-pop-mode Ihor Radchenko
@ 2020-03-18 19:57   ` Mark E. Shoulson
  2020-03-22 14:58   ` org-pop-mode Mark E. Shoulson
  1 sibling, 0 replies; 9+ messages in thread
From: Mark E. Shoulson @ 2020-03-18 19:57 UTC (permalink / raw)
  To: Ihor Radchenko, org-mode mailing list

On 3/18/20 3:00 AM, Ihor Radchenko wrote:
>> Any feedback?
> >From the first glance it does not look too different from inline
> headings. Could you highlight the difference?
>
> Best,
> Ihor

Well, it's true there is similarity.  I even found in my notes where I 
noticed inline tasks and their similarity, but all I wrote there was 
"but mine is different," so maybe that isn't so helpful.  I have not 
used inline tasks, and was only barely familiar with them (I did know 
they existed, though), so that is my excuse for having invented my own 
wheel.

In terms of differences, let's see:

inline tasks are, from a strict outline point-of-view, a zillion levels 
down (approximately), which makes them indent waaaay over if you're 
using org-indent-mode.  My org-pop is the "normal," expected single 
level down.

inline tasks mark the end of the task with a special header at the same 
level as the task.  Org-pop marks the end of the digression with a 
special header at the same level as the "base" (the surrounding text).  
Your call as to what makes better sense.

inline tasks are well-integrated and worked deep into the innards of 
org-mode, to the point that it seems from looking at code that they 
cause something of a headache to developers with their exceptional 
behavior.  On the plus side, that means that many/most packages will Do 
the Right Thing in the face of inline tasks.  My org-pop is new and 
non-standard, with hacks to make a few key things work right with it, 
but doesn't have the support of... well, anything else.  I'm pretty sure 
exporting works well with inline tasks, but currently org-pop has no 
special tweaks for it (I'm not even sure what they should be).  This is 
a reason to stick with inline tasks.

Both approaches sinfully break the underlying outline-mode structure, 
which explicitly forbids exactly what we're trying to accomplish with 
them.  Inline tasks have (way) more seniority and support and indulgence 
for doing so, though.

I haven't experimented much with inline tasks as regards the two or 
three behaviors that I actually cared enough about to write org-pop; 
have to see if they do something like I would have wanted.

Thanks!

~mark

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

* Re: org-pop-mode
  2020-03-18 19:15 ` org-pop-mode Adam Porter
@ 2020-03-18 20:05   ` Mark E. Shoulson
  2020-03-18 20:24     ` org-pop-mode Adam Porter
  0 siblings, 1 reply; 9+ messages in thread
From: Mark E. Shoulson @ 2020-03-18 20:05 UTC (permalink / raw)
  To: emacs-orgmode

On 3/18/20 3:15 PM, Adam Porter wrote:
> "Mark E. Shoulson" <mark@shoulson.com> writes:
>
>> This is something I've wanted for years in org-mode, but which in some
>> ways could actually be _offensive_ to its ideals.  If you're an
>> outline purist, look away.
>>
>> ...
>>
>> So, I present a pre-alpha version,
>> https://gist.github.com/clsn/09ac4b098b6ad7366bb5e0bc88882d5f of
>> org-pop-mode.  To "pop" back up, create a headline at the level you're
>> popping back to, and give it a tag of "contd", and the headline text
>> should not be something important.  Instructions and explanations are
>> in the comments of the file (the part about installing from MELPA is a
>> lie, though).
>>
>> Any feedback?
> Hi Mark,
>
> Indeed, this is something that is frequently asked about.  I probably
> wouldn't use it myself, but it looks like you've done a good job on it.
> Here is some feedback:
>
> 1.  I'd suggest a more descriptive name, especially if you plan to
> publish it to MELPA.  org-pop doesn't seem to convey anything about what
> it does.  :)

Heh; fair enough.  The filename originally was "org-level-end.el", I 
think; I started using the catchier "org-pop" because... well, it was 
catchier.  It made sense in my mind, in the "push"/"pop" sense used with 
stacks in programming, that you "push" to a deeper level and this 
library would allow you to "pop" back up to a higher one.  I'll see if I 
can think of something better, thanks.

> 2.  In the code, I saw you comment about cl-flet, and I see you using
> fset and unwind-protect in the org-pop-with-continuations macro.
> Instead, use cl-letf with symbol-function, like:
>
>    (cl-letf* (((symbol-function 'foo)
>                #'my-foo)
>               ((symbol-function 'bar)
>                (lambda ()
>                  ...)))
>      BODY)
>
> See also Nic Ferrier's package, noflet.

I'll take a look, thanks.  It's questionable whether I really should 
even be messing about with that macro anyway.  I must have removed the 
comments, but I had a whole thing there about how I had been trying with 
cl-letf and/or cl-flet and it didn't work. Thing is, cl-flet, according 
to the docs, (info:cl#Function Bindings) is strictly *lexical* binding, 
which is not going to cut it.  cl-letf might be different; the docs are 
different about it, but I am pretty sure I tried it and it didn't work, 
or didn't work "enough of the time."  But maybe I had it wrong, and 
maybe noflet will succeed.

Thanks!

~mark

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

* Re: org-pop-mode
  2020-03-18 20:05   ` org-pop-mode Mark E. Shoulson
@ 2020-03-18 20:24     ` Adam Porter
  2020-03-18 20:52       ` org-pop-mode Mark E. Shoulson
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Porter @ 2020-03-18 20:24 UTC (permalink / raw)
  To: emacs-orgmode

"Mark E. Shoulson" <mark@shoulson.com> writes:

> Heh; fair enough.  The filename originally was "org-level-end.el", I
> think; I started using the catchier "org-pop" because... well, it was
> catchier.  It made sense in my mind, in the "push"/"pop" sense used
> with stacks in programming, that you "push" to a deeper level and this
> library would allow you to "pop" back up to a higher one.  I'll see if
> I can think of something better, thanks.

Well, org-heading-push-pop wouldn't be a /great/ name, but the push/pop
paradigm is understandable, so you might consider that.  :)

>
>> 2.  In the code, I saw you comment about cl-flet, and I see you using
>> fset and unwind-protect in the org-pop-with-continuations macro.
>> Instead, use cl-letf with symbol-function, like:
>>
>>    (cl-letf* (((symbol-function 'foo)
>>                #'my-foo)
>>               ((symbol-function 'bar)
>>                (lambda ()
>>                  ...)))
>>      BODY)
>>
>> See also Nic Ferrier's package, noflet.
>
> I'll take a look, thanks.  It's questionable whether I really should
> even be messing about with that macro anyway.  I musnt have removed the
> comments, but I had a whole thing there about how I had been trying
> with cl-letf and/or cl-flet and it didn't work. Thing is, cl-flet,
> according to the docs, (info:cl#Function Bindings) is strictly
> *lexical* binding, which is not going to cut it.  cl-letf might be
> different; the docs are different about it, but I am pretty sure I
> tried it and it didn't work, or didn't work "enough of the time."  But
> maybe I had it wrong, and maybe noflet will succeed.

The issue is what the macros expand to.  cl-letf rebinds the function
symbols, just like fset, so it affects all code that runs in Emacs until
the function symbols are set again.  cl-flet expands into lambdas bound
to variables and replaces calls to them with funcall, so it only affects
calls in the macro's body.  Use pp-macroexpand-last-sexp to see the
expansions.

BTW, in the body of your email, the text you write has these two
characters between sentences: "  ".  The second is a plain space, but
the first is a Unicode non-breaking space, or "C-x 8 RET a0".  I noticed
because it's displayed in Emacs as an underline character next to the
plain space.

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

* Re: org-pop-mode
  2020-03-18 20:24     ` org-pop-mode Adam Porter
@ 2020-03-18 20:52       ` Mark E. Shoulson
  0 siblings, 0 replies; 9+ messages in thread
From: Mark E. Shoulson @ 2020-03-18 20:52 UTC (permalink / raw)
  To: emacs-orgmode

On 3/18/20 4:24 PM, Adam Porter wrote:
> BTW, in the body of your email, the text you write has these two
> characters between sentences: "  ".  The second is a plain space, but
> the first is a Unicode non-breaking space, or "C-x 8 RET a0".  I noticed
> because it's displayed in Emacs as an underline character next to the
> plain space.
>
Huh!  Interesting.  Because I know for a fact that I'm hitting the space 
bar twice and not a NBSP.  (I use and maintain 
https://github.com/kragen/xcompose so I can type all kinds of things; 
NBSP is Multi-Key Space Space).  I guess because my mailer has me 
composing things in HTML mode, and I double-space my periods, and it's 
thinking "strings of whitespace are collapsed into a single space in 
HTML!  I'd better do something to make sure those extra spaces, which he 
took so much care to type, aren't lost!" and makes on a NBSP to take up 
extra space.  (There was recently a whole discussion on the Unicode 
mailing list about how 0x00A0 is almost universally used as a 
fixed-width space when the specs say it should be flex-width, sigh.)

~mark

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

* Re: org-pop-mode
  2020-03-18  7:00 ` org-pop-mode Ihor Radchenko
  2020-03-18 19:57   ` org-pop-mode Mark E. Shoulson
@ 2020-03-22 14:58   ` Mark E. Shoulson
  2020-03-22 18:15     ` org-pop-mode Ihor Radchenko
  1 sibling, 1 reply; 9+ messages in thread
From: Mark E. Shoulson @ 2020-03-22 14:58 UTC (permalink / raw)
  To: emacs-orgmode

On 3/18/20 3:00 AM, Ihor Radchenko wrote:
>> Any feedback?
> >From the first glance it does not look too different from inline
> headings. Could you highlight the difference?
>
> Best,
> Ihor

Oh! And I forgot a crucial feature that org-pop has over inline tasks: 
you can put any amount of org-mode tree-structure inside an org-pop 
digression.  Inline tasks seem to be limited to just body text; you 
can't put sub-headings inside them, etc.  Org-pop digressions can 
contain sub-headings and whatever other structure, even further 
digressions and "pop"s.  So that's something significant that inline 
headings lack.

~mark

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

* Re: org-pop-mode
  2020-03-22 14:58   ` org-pop-mode Mark E. Shoulson
@ 2020-03-22 18:15     ` Ihor Radchenko
  0 siblings, 0 replies; 9+ messages in thread
From: Ihor Radchenko @ 2020-03-22 18:15 UTC (permalink / raw)
  To: Mark E. Shoulson, emacs-orgmode


> Inline tasks seem to be limited to just body text; you 
> can't put sub-headings inside them, etc.  Org-pop digressions can 
> contain sub-headings and whatever other structure, even further 
> digressions and "pop"s.  So that's something significant that inline 
> headings lack.

Thanks for clarifying. Do you actually use this feature? It was hard for
me to come out with anything fitting my workflow.

I tried to play very little with org-pop just now. Generally it looks a
lot like inline tasks, but indeed a lot less integrated with standard
org features.

Some observations:
- the visual appearance looks same as normal org structure. While, as
you said, inline tasks are generally indented too much, the org-pop
approach shows little indication that "inline" headlines are actually
any different from normal org subheadings. Yes, you have cycling, but it
will not be really useful for entries having more than a screen full of
text. Probably, the "inline" headlines should be highlighted in some
way. 
- refiling does not touch the :contd: heading
- org-metaright and similar functions mess up the :contd: part
- creating the :contd: headline feels too manual for me. A command to
create the :contd: headline would be useful, I think.
- Archiving does not work

In summary, my impression is that hacking the existing inlinetask
functionality to change visual appearance of inlinetasks (maybe less
indentation) and to allow subtasks could be easier if you really want to
integrate the whole thing with org-mode. 

Best,
Ihor



"Mark E. Shoulson" <mark@shoulson.com> writes:

> On 3/18/20 3:00 AM, Ihor Radchenko wrote:
>>> Any feedback?
>> >From the first glance it does not look too different from inline
>> headings. Could you highlight the difference?
>>
>> Best,
>> Ihor
>
> Oh! And I forgot a crucial feature that org-pop has over inline tasks: 
> you can put any amount of org-mode tree-structure inside an org-pop 
> digression.  Inline tasks seem to be limited to just body text; you 
> can't put sub-headings inside them, etc.  Org-pop digressions can 
> contain sub-headings and whatever other structure, even further 
> digressions and "pop"s.  So that's something significant that inline 
> headings lack.
>
> ~mark
>
>

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg

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

end of thread, other threads:[~2020-03-22 18:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18  2:33 org-pop-mode Mark E. Shoulson
2020-03-18  7:00 ` org-pop-mode Ihor Radchenko
2020-03-18 19:57   ` org-pop-mode Mark E. Shoulson
2020-03-22 14:58   ` org-pop-mode Mark E. Shoulson
2020-03-22 18:15     ` org-pop-mode Ihor Radchenko
2020-03-18 19:15 ` org-pop-mode Adam Porter
2020-03-18 20:05   ` org-pop-mode Mark E. Shoulson
2020-03-18 20:24     ` org-pop-mode Adam Porter
2020-03-18 20:52       ` org-pop-mode Mark E. Shoulson

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).