Created
August 18, 2015 06:00
-
-
Save hanabokuro/3370ef1f57aa68afc678 to your computer and use it in GitHub Desktop.
Get region of string under cursor
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 get-string-region-at-cursor () | |
(save-excursion | |
(let (beg) | |
(setq beg (nth 8 (parse-partial-sexp 1 (point)))) | |
(if beg | |
(progn | |
(goto-char beg) | |
(forward-sexp) | |
(list (1+ beg) (1- (point)))) | |
nil) | |
))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment