Skip to content

Instantly share code, notes, and snippets.

@hanabokuro
Created August 18, 2015 06:00
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 hanabokuro/3370ef1f57aa68afc678 to your computer and use it in GitHub Desktop.
Save hanabokuro/3370ef1f57aa68afc678 to your computer and use it in GitHub Desktop.
Get region of string under cursor
(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