Function: expand-in-literal
expand-in-literal is a byte-compiled function defined in expand.el.gz.
Signature
(expand-in-literal)
Documentation
Test if we are in a comment or in a string.
Source Code
;; Defined in /usr/src/emacs/lisp/expand.el.gz
(defun expand-in-literal ()
"Test if we are in a comment or in a string."
(save-excursion
(let* ((lim (or (save-excursion
(beginning-of-defun)
(point))
(point-min)))
(state (parse-partial-sexp lim (point))))
(cond
((nth 3 state) 'string)
((nth 4 state) 'comment)
(t nil)))))