Skip to content

Instantly share code, notes, and snippets.

@johnbcoughlin
Created June 13, 2019 14:59
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 johnbcoughlin/de5586229ae843c3c523089eee226e59 to your computer and use it in GitHub Desktop.
Save johnbcoughlin/de5586229ae843c3c523089eee226e59 to your computer and use it in GitHub Desktop.
(defun motion-wrapper (motion)
(progn
;; Attempt a motion command, allowing it to end up inside of an overlay.
(condition-case nil
(funcall motion)
;; If it fails, remove the overlay at point if any
(error (progn
(message "error happened!")
(function-to-remove-overlay))))
(let ((overlay (function-to-get-overlay-at-point)))
(if overlay
(progn
(setq disable-point-adjustment t)
(setq cursor-type nil))
(setq cursor-type t)))))
@analyticd
Copy link

analyticd commented Jun 13, 2019

Would be cool, when/if this is done, to integrate into: https://gist.github.com/analyticd/acfa3c4ff7dd643d39df90f3253de963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment