"Face for highlighting face names in Emacs Lisp code."
:group 'lisp)
+(defface elisp-function-call '((t :inherit font-lock-function-call-face))
+ "Face for highlighting function calls in Emacs Lisp code."
+ :group 'lisp)
+
(defface elisp-macro-call '((t :inherit font-lock-keyword-face))
"Face for highlighting macro calls in Emacs Lisp code."
:group 'lisp)
(cl-case type
(variable 'elisp-free-variable)
(face 'elisp-face)
- (function 'font-lock-function-call-face)
+ (function 'elisp-function-call)
(macro 'elisp-macro-call)
(special-form 'elisp-special-form)
(throw-tag 'elisp-throw-tag)
(defun elisp--fnsym-in-current-sexp ()
(save-excursion
(unless (nth 8 (syntax-ppss))
- (let ((argument-index (1- (elisp--beginning-of-sexp))))
- ;; If we are at the beginning of function name, this will be -1.
- (when (< argument-index 0)
- (setq argument-index 0))
- (list (elisp--current-symbol) argument-index)))))
+ (catch 'ball nil
+ (while t
+ (let ((argument-index (1- (elisp--beginning-of-sexp))))
+ ;; If we are at the beginning of function name, this will be -1.
+ (when (< argument-index 0)
+ (setq argument-index 0))
+ (if (memq (get-text-property (point) 'face)
+ '(elisp-special-form elisp-macro-call elisp-function-call))
+ (throw 'ball (list (elisp--current-symbol) argument-index))
+ (condition-case nil
+ (backward-up-list)
+ (scan-error (throw 'ball nil))))))))))
;; Move to the beginning of current sexp. Return the number of nested
;; sexp the point was over or after.