From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: ANN: org-sticky-header Date: Tue, 18 Apr 2017 15:55:13 +0200 Message-ID: References: <87k26itxex.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114349d600d973054d714399 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0TbV-00032q-Jk for emacs-orgmode@gnu.org; Tue, 18 Apr 2017 09:55:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0TbU-0007N9-3s for emacs-orgmode@gnu.org; Tue, 18 Apr 2017 09:55:37 -0400 Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:35424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0TbT-0007Mv-Qk for emacs-orgmode@gnu.org; Tue, 18 Apr 2017 09:55:36 -0400 Received: by mail-io0-x22d.google.com with SMTP id r16so188291153ioi.2 for ; Tue, 18 Apr 2017 06:55:35 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: John Kitchin Cc: Adam Porter , org-mode list --001a114349d600d973054d714399 Content-Type: text/plain; charset=UTF-8 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 > --001a114349d600d973054d714399 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hahaha, stupid me, full outline path is already implemente= d.

Excellent.

Carsten

On Tue, Apr 18,= 2017 at 3:51 PM, John Kitchin <jkitchin@andrew.cmu.edu> wrote:
Indeed, very cool!

The spacing seems to come in here:

(defun org-sticky-header--fetch-stickyline ()
=C2=A0 "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."
=C2=A0 (save-excursion
=C2=A0 =C2=A0 (goto-char (window-start))
=C2=A0 =C2=A0 (unless (org-at-heading-p)
=C2=A0 =C2=A0 =C2=A0 (org-back-to-heading)
=C2=A0 =C2=A0 =C2=A0 ;; TODO: 3 spaces seems to be almost right, but it'= ;s still not
=C2=A0 =C2=A0 =C2=A0 ;; perfect, and it's probably not universally righ= t.=C2=A0 Something
=C2=A0 =C2=A0 =C2=A0 ;; related to org-indent might be good.
=C2=A0 =C2=A0 =C2=A0 (if org-sticky-header-full-path
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-format-outline-path (org-get-outlin= e-path t) nil "=C2=A0 =C2=A0")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat "=C2=A0 =C2=A0" (buffer-subst= ring (line-beginning-position)
=C2=A0 (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 t= he
> most recent heading, but, space permitting, the outline path - maybe i= n
> reverse order as to keep the sticky heading itself in the left-most co= lumn.
>
> 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 b= e 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 <adam@alphapapa.net> 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.=C2=A0 When you scrol= l 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 headin= g the
>> partially displayed entry at the top belongs to.
>>
>> It seems to be working well so far.=C2=A0 Please let me know if yo= u 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

--001a114349d600d973054d714399--