Skip to content

Instantly share code, notes, and snippets.

@stsquad
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stsquad/39d84d81870a11bc1a21 to your computer and use it in GitHub Desktop.
Save stsquad/39d84d81870a11bc1a21 to your computer and use it in GitHub Desktop.
(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
Copy link
Author

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