Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying info panel at top of buffer
    text
    copied!<p>I'd like to display a few lines at the top of the buffer, but not as part of the actual buffer text, just for display.</p> <p>Specifically, I'd like to display a Git timeline (not yet released, sorry), like this automatically when I open a file, so I can easily see any recent activity:</p> <pre><code> P DP D D T=F=S=S=M=T=W=T=F=S=S=M=T=W=T=F=S=S=M==T==W==T==F==S==S==M==T==W==T==F==S==S==M= 11 18 25 2 9 </code></pre> <p>(Single chars are first initials of people with commits on those days. There will be a legend below as well)</p> <p>It sounds like I want something like the <a href="http://www.emacswiki.org/emacs/HeaderLine" rel="nofollow">header line</a>, but for the buffer. Is there anything like that?</p> <p>One idea I had was to use an overlay at the start of the buffer and put my text there, but I'm not at all sure this is "the right thing" or a completely inappropriate / unsuitable use of this.</p> <p>I tried, and got it working, using an overlay of the char at (point-min), with the text-property of 'before-string and the string literal above (with newlines and a trailing newline). Here's a proof of concept:</p> <pre><code>(defun test/add-overlay () (interactive) (setq test/timeline-overlay (make-overlay (point-min) (+ (point-min) 1))) (overlay-put test/timeline-overlay 'timeline-panel t) (overlay-put test/timeline-overlay 'before-string (propertize " P DP D D \nT=F=S=S=M=T=W=T=F=S=S=M=T=W=T=F=S=S=M==T==W==T==F==S==S==M==T==W==T==F==S==S==M=\n 11 18 25 2 9 " 'face 'font-lock-comment-face)) ) (defun test/remove-overlay () (interactive) (remove-overlays (point-min) (point-max) 'timeline-panel t) ) </code></pre> <p>This does seem to work quite fine, but I'm not sure if it might conflict with something else. </p> <p>Is this the way to go, or are the more suitable user interface constructs in Emacs to do what I want?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload