2

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.

Saravana
  • 2,071
  • 13
  • 32

1 Answers1

2

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 "...")
Saravana
  • 2,071
  • 13
  • 32