Skip to content

Instantly share code, notes, and snippets.

@stsquad

stsquad/overlay-hacking

Last active Aug 29, 2015
Embed
What would you like to do?
(defvar my-overlays nil)
(let ((start (point-min)))
(save-excursion
(goto-char start)
(while (re-search-forward "aaaa" nil t)
(let ((overlay (make-overlay start (- (match-beginning 0) 1))))
(add-to-list 'my-overlays overlay))
(forward-line)
(setq start (point)))))
(let ((o (car (last my-overlays))))
(overlay-put o 'invisible t))
@stsquad

This comment has been minimized.

Copy link
Owner Author

@stsquad stsquad commented May 28, 2015

Obviously this code is partial and doesn't hide all the overlays it's created. It also needs code to restore the overlays after being done. Oh and the variable should be buffer local - yadda yadda...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.