My buffer has one line as,
i am sitting on an overlay
Now when i do, M-x some-function-to-hide
, i like to hide the text from display, and show three dots as,
...
I am looking forward to have a "hello world" program to understand overlays.
Reproducing lawlist's comments here, To make an overlay and minify the code block as "...", you can do,
(overlay-put (make-overlay (point-at-bol) (point-at-eol)) 'display "...")
Now, to expand the contents and bring the buffer to its original form,
(remove-overlays (point-min) (point-max) 'display "...")
(overlay-put (make-overlay (point-at-bol) (point-at-eol)) 'display "...")
– lawlist Feb 27 '15 at 17:32(remove-overlays)
– Saravana Feb 27 '15 at 17:34(remove-overlays (point-min) (point-max) 'display "...")
I am at work today and won't have a chance to do an answer until later. I'm not picky -- anyone can write-up an answer, even yourself if you are so inclined. – lawlist Feb 27 '15 at 17:38