Function: cape-wrap-inside-code

cape-wrap-inside-code is an autoloaded and byte-compiled function defined in cape.el.

Signature

(cape-wrap-inside-code CAPF)

Documentation

Call CAPF only if inside code, not inside a comment or string.

This function can be used as an advice around an existing Capf.

Source Code

;; Defined in ~/.emacs.d/elpa/cape-20260804.2303/cape.el
;;;###autoload
(defun cape-wrap-inside-code (capf)
  "Call CAPF only if inside code, not inside a comment or string.
This function can be used as an advice around an existing Capf."
  (let ((s (syntax-ppss)))
    (and (not (nth 3 s)) (not (nth 4 s)) (funcall capf))))