Created
June 13, 2019 14:59
-
-
Save johnbcoughlin/de5586229ae843c3c523089eee226e59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would be cool, when/if this is done, to integrate into: https://gist.github.com/analyticd/acfa3c4ff7dd643d39df90f3253de963