(let ((defun (looking-at
"(\\(?:cl-\\)?def\\(un\\|macro\\|subst\\|advice\\|generic\\|method\\)"))
(is-advice (looking-at "(defadvice"))
+ (defun-depth (ppss-depth (syntax-ppss)))
(lst nil)
(ret nil)
(oo (make-vector 3 0))) ;substitute obarray for `read'
(setq ret (cons nil ret))
;; Interactive
(save-excursion
- (setq ret (cons
- (re-search-forward "^\\s-*(interactive"
- (save-excursion (end-of-defun) (point))
- t)
- ret)))
+ (push (and (re-search-forward "^\\s-*(interactive"
+ (save-excursion
+ (end-of-defun)
+ (point))
+ t)
+ ;; Disregard `interactive' from other parts of
+ ;; the function.
+ (= (ppss-depth (syntax-ppss))
+ (+ defun-depth 2))
+ (point))
+ ret))
(skip-chars-forward " \t\n")
(let ((bss (buffer-substring (point) (save-excursion (forward-sexp 1)
(point))))