Re: [O] ANN: org-sticky-header

2017-04-24 Thread Eric S Fraga
On Wednesday, 19 Apr 2017 at 21:33, Adam Porter wrote:
> Inline tasks are now skipped.  Thanks!

Excellent.  Thanks!

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.5-444-g998576


signature.asc
Description: PGP signature


Re: [O] ANN: org-sticky-header

2017-04-22 Thread Charles C. Berry

On Wed, 19 Apr 2017, Adam Porter wrote:


This should now be fixed.  Thanks!



I have encountered a bug when trying to export a subtree containing an 
inlinetask just after the headline/metadata and a src block further down.


Here is an ECM:

--8<---cut here---start->8---
* a Headline
*** my task

  Do this well!

*** END

#+NAME: my-model
#+BEGIN_src latex :results latex
  \begin{displaymath}
y = x + z
  \end{displaymath}
#+END_src
--8<---cut here---end--->8---

Put the cursor under the headline (at the end of buffer, say) then type

C-c C-e C-s l L y

and without org-sticky-header mode you get an exported buffer.

With org-sticky-header mode, it just hangs after the 'y' is typed.

Also, if you put point at the beginning of the second line (the start
of the inlinetask) and type

: M-: (narrow-to-region (point) (point-max))

it will narrow if o-s-h mode is off, but hang if it is on.

Adding a newline after the headline `cures' the export problem.
However, if point is at the start of an inlinetask, then emacs will
hang when running the narrow-to-region snippet above regardless of
newlines.

p.s. I am using commit b82b4f210e... (newest at this time)

Chuck



Re: [O] ANN: org-sticky-header

2017-04-19 Thread Adam Porter
Inline tasks are now skipped.  Thanks!




Re: [O] ANN: org-sticky-header

2017-04-19 Thread Adam Porter
This should now be fixed.  Thanks!




Re: [O] ANN: org-sticky-header

2017-04-19 Thread Adam Porter
Carsten Dominik  writes:

> here is a new patch with does do this correctly.

Thanks, Carsten, I will work on this soon.




Re: [O] ANN: org-sticky-header

2017-04-19 Thread Adam Porter
Thanks, Eric and Carsten.  I'll look into this soon.




Re: [O] ANN: org-sticky-header

2017-04-19 Thread Carsten Dominik
On Wed, Apr 19, 2017 at 8:07 AM, Eric S Fraga  wrote:

> On Tuesday, 18 Apr 2017 at 23:53, Adam Porter wrote:
> > I was using three spaces, which looked okay on my system, but I'm sure
> > it didn't look right on everyone's.  I added an option to configure it
> > now.  It would be nice to calculate it automatically somehow, but this
> > should be an improvement.
>
> Excellent.  Thank you.
>
> One other minor issue: if there are any inline tasks, the sticky header
> shows "END" if there is such an inline task not in the window but
> between point and the previous headline.  I think that if point is not
> within an inline task, you should be skipping inline tasks (my own
> preference) or displaying the headline for the task and not the END
> line.
>

That would be hard to implement.  Skipping inline tasks entirely would
be easy enough, just truncate the list of path entries to below
org-inlinetask-min-level.

Carsten


>
> Thanks again,
> eric
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.5-444-g998576
>


Re: [O] ANN: org-sticky-header

2017-04-19 Thread Eric S Fraga
On Tuesday, 18 Apr 2017 at 23:53, Adam Porter wrote:
> I was using three spaces, which looked okay on my system, but I'm sure
> it didn't look right on everyone's.  I added an option to configure it
> now.  It would be nice to calculate it automatically somehow, but this
> should be an improvement.

Excellent.  Thank you.

One other minor issue: if there are any inline tasks, the sticky header
shows "END" if there is such an inline task not in the window but
between point and the previous headline.  I think that if point is not
within an inline task, you should be skipping inline tasks (my own
preference) or displaying the headline for the task and not the END
line.

Thanks again,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.5-444-g998576


signature.asc
Description: PGP signature


Re: [O] ANN: org-sticky-header

2017-04-19 Thread Carsten Dominik
Hi Adam,

here is a new patch with does do this correctly.

Cheers

Carsten

On Wed, Apr 19, 2017 at 7:52 AM, Carsten Dominik  wrote:

> Hi Adam,
>
> and just after I send this, I now see that the faces of the headings
> in the path are now wrong - so you probably already had gone down
> this path.  Sorry for the noise, need to come up with something better.
>
> Carsten
>
> On Wed, Apr 19, 2017 at 7:46 AM, Carsten Dominik  wrote:
>
>> Hi Adam,
>>
>> thanks for adding the option to reverse the outline path.  Great thinking
>> about using a different separator for the reversed path!
>>
>> It mostly works - however, if the window is too narrow, the abbreviation
>> ellipses are now applied to the most recent heading instead of to the last
>> one shown.  It would be better to reverse the outline path before sending
>> it into org-format-outline-path, which also saves you the pain to split and
>> rejoin the path string.
>>
>> Please find attached a patch that makes this change.  It also removes the
>> dependence on the string library which is, I think, not by default
>> available in Emacs.
>>
>> Thanks
>>
>> On Wed, Apr 19, 2017 at 1:06 AM, Adam Porter  wrote:
>>
>>> Carsten Dominik  writes:
>>>
>>> Hi Carsten,
>>>
>>> > I am wondering if you would consider the possibility to show on only
>>> > the most recent heading, but, space permitting, the outline path -
>>> > maybe in reverse order as to keep the sticky heading itself in the
>>> > left-most column.
>>>
>>> That's a great idea, I will add that.  Thanks.
>>>
>>>
>>>
>>
>


patch
Description: Binary data


Re: [O] ANN: org-sticky-header

2017-04-18 Thread Carsten Dominik
Hi Adam,

and just after I send this, I now see that the faces of the headings
in the path are now wrong - so you probably already had gone down
this path.  Sorry for the noise, need to come up with something better.

Carsten

On Wed, Apr 19, 2017 at 7:46 AM, Carsten Dominik  wrote:

> Hi Adam,
>
> thanks for adding the option to reverse the outline path.  Great thinking
> about using a different separator for the reversed path!
>
> It mostly works - however, if the window is too narrow, the abbreviation
> ellipses are now applied to the most recent heading instead of to the last
> one shown.  It would be better to reverse the outline path before sending
> it into org-format-outline-path, which also saves you the pain to split and
> rejoin the path string.
>
> Please find attached a patch that makes this change.  It also removes the
> dependence on the string library which is, I think, not by default
> available in Emacs.
>
> Thanks
>
> On Wed, Apr 19, 2017 at 1:06 AM, Adam Porter  wrote:
>
>> Carsten Dominik  writes:
>>
>> Hi Carsten,
>>
>> > I am wondering if you would consider the possibility to show on only
>> > the most recent heading, but, space permitting, the outline path -
>> > maybe in reverse order as to keep the sticky heading itself in the
>> > left-most column.
>>
>> That's a great idea, I will add that.  Thanks.
>>
>>
>>
>


Re: [O] ANN: org-sticky-header

2017-04-18 Thread Carsten Dominik
Hi Adam,

thanks for adding the option to reverse the outline path.  Great thinking
about using a different separator for the reversed path!

It mostly works - however, if the window is too narrow, the abbreviation
ellipses are now applied to the most recent heading instead of to the last
one shown.  It would be better to reverse the outline path before sending
it into org-format-outline-path, which also saves you the pain to split and
rejoin the path string.

Please find attached a patch that makes this change.  It also removes the
dependence on the string library which is, I think, not by default
available in Emacs.

Thanks

On Wed, Apr 19, 2017 at 1:06 AM, Adam Porter  wrote:

> Carsten Dominik  writes:
>
> Hi Carsten,
>
> > I am wondering if you would consider the possibility to show on only
> > the most recent heading, but, space permitting, the outline path -
> > maybe in reverse order as to keep the sticky heading itself in the
> > left-most column.
>
> That's a great idea, I will add that.  Thanks.
>
>
>


patch
Description: Binary data


Re: [O] ANN: org-sticky-header

2017-04-18 Thread Adam Porter
Eric S Fraga  writes:

> One minor point: for some reason, the contents of the header line are
> shifted to the right by one character so there's a little dissonance.
> I use org-indent-mode in case that matters.

Hi Eric,

Oops, for some reason this message wasn't threaded and I missed it.

I was using three spaces, which looked okay on my system, but I'm sure
it didn't look right on everyone's.  I added an option to configure it
now.  It would be nice to calculate it automatically somehow, but this
should be an improvement.




Re: [O] ANN: org-sticky-header

2017-04-18 Thread Adam Porter
Thanks for your feedback, everyone.  I've just pushed some updates that
add options for the prefix and reversing the path display.  Please let
me know if you have any other ideas or issues.




Re: [O] ANN: org-sticky-header

2017-04-18 Thread Adam Porter
John Kitchin  writes:

Hi John,

> Maybe the three spaces should be stored in a defcustom. I like no spaces
> personally.

Yep, I will put it in an option right away.  Thanks.




Re: [O] ANN: org-sticky-header

2017-04-18 Thread Adam Porter
Eric Abrahamsen  writes:

> I love it! I've wanted something like this for long text files for ages
> -- this scratches a very old itch. Thanks for doing this, and I'll
> report back with issues, though it's work great so far.

Thanks, Eric, I'm glad it's useful for you.  :)




Re: [O] ANN: org-sticky-header

2017-04-18 Thread Adam Porter
Eric S Fraga  writes:

> It is indeed but it would still be nice to have it in reverse order, as
> you suggested in an earlier post.  My top level headline overwhelms the
> header...

Will fix that right away, thanks!




Re: [O] ANN: org-sticky-header

2017-04-18 Thread Adam Porter
Carsten Dominik  writes:

Hi Carsten,

> I am wondering if you would consider the possibility to show on only
> the most recent heading, but, space permitting, the outline path -
> maybe in reverse order as to keep the sticky heading itself in the
> left-most column.

That's a great idea, I will add that.  Thanks.




Re: [O] ANN: org-sticky-header

2017-04-18 Thread Leslie Watter
I really liked it. I'm editing a huge document and it helps a lot having
the clue in which header I am!

Thanks

LEslie

On Tue, Apr 18, 2017 at 2:22 PM, Eric S Fraga  wrote:

> On Tuesday, 18 Apr 2017 at 13:55, Carsten Dominik wrote:
> > Hahaha, stupid me, full outline path is already implemented.
>
> It is indeed but it would still be nice to have it in reverse order, as
> you suggested in an earlier post.  My top level headline overwhelms the
> header...
>
> --
> Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)
>



-- 
Leslie H. Watter


Re: [O] ANN: org-sticky-header

2017-04-18 Thread Eric S Fraga
On Tuesday, 18 Apr 2017 at 13:55, Carsten Dominik wrote:
> Hahaha, stupid me, full outline path is already implemented.

It is indeed but it would still be nice to have it in reverse order, as
you suggested in an earlier post.  My top level headline overwhelms the
header...

-- 
Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)


signature.asc
Description: PGP signature


Re: [O] ANN: org-sticky-header

2017-04-18 Thread Kaushal Modi
On Tue, Apr 18, 2017 at 9:30 AM Carsten Dominik  wrote:

> Hi Adam,
>
> this is great, I love it!
>
> I am wondering if you would consider the possibility to show on only the
> most recent heading, but, space permitting, the outline path - maybe in
> reverse order as to keep the sticky heading itself in the left-most column.
>
> Something like
>
> *** current level | ** level above | * top level
>
> you could use `org-get-outline-path' to get the other headings up the tree.
>
> I don't necessarily think it should be the default, but it could be an
> option.
>
> Cheers
>

On that note, there is also org-eldoc.el in contrib/ that sort of does what
you want.

"sort of" because:

- Shows the breadcrumbs in the echo area instead of in header.
- Shows that only when point is on an org heading, not when in the body.

[image: pasted1]
-- 

Kaushal Modi


Re: [O] ANN: org-sticky-header

2017-04-18 Thread Carsten Dominik
Hahaha, stupid me, full outline path is already implemented.

Excellent.

Carsten

On Tue, Apr 18, 2017 at 3:51 PM, John Kitchin 
wrote:

> Indeed, very cool!
>
> The spacing seems to come in here:
>
> (defun org-sticky-header--fetch-stickyline ()
>   "Make the heading at the top of the current window sticky.
> Capture its heading line, and place it in the header line.
> If there is no heading, disable the header line."
>   (save-excursion
> (goto-char (window-start))
> (unless (org-at-heading-p)
>   (org-back-to-heading)
>   ;; TODO: 3 spaces seems to be almost right, but it's still not
>   ;; perfect, and it's probably not universally right.  Something
>   ;; related to org-indent might be good.
>   (if org-sticky-header-full-path
>   (org-format-outline-path (org-get-outline-path t) nil "   ")
> (concat "   " (buffer-substring (line-beginning-position)
>   (line-end-position)))
>
> Maybe the three spaces should be stored in a defcustom. I like no spaces
> personally.
>
> Carsten Dominik writes:
>
> > Hi Adam,
> >
> > this is great, I love it!
> >
> > I am wondering if you would consider the possibility to show on only the
> > most recent heading, but, space permitting, the outline path - maybe in
> > reverse order as to keep the sticky heading itself in the left-most
> column.
> >
> > Something like
> >
> > *** current level | ** level above | * top level
> >
> > you could use `org-get-outline-path' to get the other headings up the
> tree.
> >
> > I don't necessarily think it should be the default, but it could be an
> > option.
> >
> > Cheers
> >
> > Carsten
> >
> > P.S. I also see what Eric Fraga is seeing and would love to have this
> issue
> > solved.
> >
> >
> > On Tue, Apr 18, 2017 at 1:41 AM, Adam Porter  wrote:
> >
> >> Hi friends,
> >>
> >> I've posted another package which you might find useful:
> >>
> >> https://github.com/alphapapa/org-sticky-header
> >>
> >> It's modeled on semantic-stickyfunc-mode.  When you scroll down and push
> >> an Org heading out of view, it displays that heading in the Emacs header
> >> line at the top of the window so you don't forget which heading the
> >> partially displayed entry at the top belongs to.
> >>
> >> It seems to be working well so far.  Please let me know if you have any
> >> feedback.
> >>
> >> Thanks,
> >> Adam
> >>
> >>
> >>
>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>


Re: [O] ANN: org-sticky-header

2017-04-18 Thread John Kitchin
Indeed, very cool!

The spacing seems to come in here:

(defun org-sticky-header--fetch-stickyline ()
  "Make the heading at the top of the current window sticky.
Capture its heading line, and place it in the header line.
If there is no heading, disable the header line."
  (save-excursion
(goto-char (window-start))
(unless (org-at-heading-p)
  (org-back-to-heading)
  ;; TODO: 3 spaces seems to be almost right, but it's still not
  ;; perfect, and it's probably not universally right.  Something
  ;; related to org-indent might be good.
  (if org-sticky-header-full-path
  (org-format-outline-path (org-get-outline-path t) nil "   ")
(concat "   " (buffer-substring (line-beginning-position)
  (line-end-position)))

Maybe the three spaces should be stored in a defcustom. I like no spaces
personally.

Carsten Dominik writes:

> Hi Adam,
>
> this is great, I love it!
>
> I am wondering if you would consider the possibility to show on only the
> most recent heading, but, space permitting, the outline path - maybe in
> reverse order as to keep the sticky heading itself in the left-most column.
>
> Something like
>
> *** current level | ** level above | * top level
>
> you could use `org-get-outline-path' to get the other headings up the tree.
>
> I don't necessarily think it should be the default, but it could be an
> option.
>
> Cheers
>
> Carsten
>
> P.S. I also see what Eric Fraga is seeing and would love to have this issue
> solved.
>
>
> On Tue, Apr 18, 2017 at 1:41 AM, Adam Porter  wrote:
>
>> Hi friends,
>>
>> I've posted another package which you might find useful:
>>
>> https://github.com/alphapapa/org-sticky-header
>>
>> It's modeled on semantic-stickyfunc-mode.  When you scroll down and push
>> an Org heading out of view, it displays that heading in the Emacs header
>> line at the top of the window so you don't forget which heading the
>> partially displayed entry at the top belongs to.
>>
>> It seems to be working well so far.  Please let me know if you have any
>> feedback.
>>
>> Thanks,
>> Adam
>>
>>
>>


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] ANN: org-sticky-header

2017-04-18 Thread Carsten Dominik
Hi Adam,

this is great, I love it!

I am wondering if you would consider the possibility to show on only the
most recent heading, but, space permitting, the outline path - maybe in
reverse order as to keep the sticky heading itself in the left-most column.

Something like

*** current level | ** level above | * top level

you could use `org-get-outline-path' to get the other headings up the tree.

I don't necessarily think it should be the default, but it could be an
option.

Cheers

Carsten

P.S. I also see what Eric Fraga is seeing and would love to have this issue
solved.


On Tue, Apr 18, 2017 at 1:41 AM, Adam Porter  wrote:

> Hi friends,
>
> I've posted another package which you might find useful:
>
> https://github.com/alphapapa/org-sticky-header
>
> It's modeled on semantic-stickyfunc-mode.  When you scroll down and push
> an Org heading out of view, it displays that heading in the Emacs header
> line at the top of the window so you don't forget which heading the
> partially displayed entry at the top belongs to.
>
> It seems to be working well so far.  Please let me know if you have any
> feedback.
>
> Thanks,
> Adam
>
>
>


Re: [O] ANN: org-sticky-header

2017-04-18 Thread Eric S Fraga
On Monday, 17 Apr 2017 at 23:41, Adam Porter wrote:
> Hi friends,
>
> I've posted another package which you might find useful:
>
> https://github.com/alphapapa/org-sticky-header

Interesting and seems to work well overall.  One minor point: for some
reason, the contents of the header line are shifted to the right by one
character so there's a little dissonance.  I use org-indent-mode in case
that matters.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.5-444-g998576


signature.asc
Description: PGP signature


Re: [O] ANN: org-sticky-header

2017-04-17 Thread Eric Abrahamsen
Adam Porter  writes:

> Hi friends,
>
> I've posted another package which you might find useful:
>
> https://github.com/alphapapa/org-sticky-header
>
> It's modeled on semantic-stickyfunc-mode.  When you scroll down and push
> an Org heading out of view, it displays that heading in the Emacs header
> line at the top of the window so you don't forget which heading the
> partially displayed entry at the top belongs to.
>
> It seems to be working well so far.  Please let me know if you have any
> feedback.

I love it! I've wanted something like this for long text files for ages
-- this scratches a very old itch. Thanks for doing this, and I'll
report back with issues, though it's work great so far.