alphapapa / topsy.el

Simple sticky header showing definition beyond top of window
GNU General Public License v3.0
100 stars 6 forks source link

[Feature Request] Also keep outline headers on top #5

Open kings2u opened 3 years ago

kings2u commented 3 years ago

I think it would be so helpful when viewing lisp files to also have the option to keep headings on top, so that at a glance you get a full glimpse of the context of where point is. The top-level heading would obviously be on top, with any subheadings beneath, and finally the relevant function title last. This means the number of lines required at the top would fluctuate as you move through the file, which hopefully wouldn’t be too hard to implement. An example of how it might look would be:

;;; Custom Variables
;;;; Appearance Variables
(defcustom var

Thank you so much for this package, and all of your wonderful packages!

alphapapa commented 3 years ago

That could be useful, and you're not the first to suggest it. But newlines in header-line-format are not rendered by Emacs, so AFAIK this would not be possible without using overlays, which would be very messy (i.e. a hook or timer would have to continually move the overlays to the position of window-start). I hope you understand that that's not something I want to do in this package. :)

However, higher-level headings could be appended to the heading string, so it would look something like:

(defcustom var \\ ;;;; Appearance Variables \\ ;;; Custom Variables

Of course, how useful that would be would depend on the width of each level's string and the window's width. But that is what org-sticky-header does (optionally), so it could be done here as well.

Thanks for the kind words.

kings2u commented 3 years ago

I would love the option you suggest! It would conserve maximum visual space and resources as you say. No rush to implement this feature, I know how busy you are :)

alphapapa commented 3 years ago

Ok. It should be a fairly simple change, so I'll mark it as help-wanted until I take a look at it sometime.