From 7743f3ed1b81fbc693d58585596bf7caf783d1c7 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 22 Feb 2021 11:51:15 +0800 Subject: More configurations Now TeX and elfeed are roughly configured. --- elisp.el | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'elisp.el') diff --git a/elisp.el b/elisp.el index 8045f64..c1c62fb 100644 --- a/elisp.el +++ b/elisp.el @@ -40,16 +40,39 @@ (search-forward "\"" end t)) ((nth 4 ppss) ; comments (forward-line +1)) - ((let ((symbol (intern-soft (match-string-no-properties 0)))) + ((let* ((symbol (intern-soft (match-string-no-properties 0))) + (paren-starts (nth 9 ppss))) (and (cond ((null symbol) nil) ((eq symbol t) nil) ((keywordp symbol) nil) ((special-variable-p symbol) (setq emacs-lisp-face 'font-lock-variable-name-face)) - ((and (fboundp symbol) - (eq (char-before (match-beginning 0)) ?\() - (not (memq (char-before (1- (match-beginning 0))) - (list ?\' ?\`)))) + ((let ((quote-before-p + (mapcar + (function + (lambda (start) + (let ((temp-char (char-before start))) + (cond + ((eq temp-char ?`) 1) + ((eq temp-char ?') 2))))) + paren-starts))) + (and (fboundp symbol) + (eq (char-before (match-beginning 0)) ?\() + (not + (or (memq 2 quote-before-p) + (and (memq 1 quote-before-p) + (not + (or (eq (char-before + (max (1- (match-beginning 0)) + (point-min))) + ?,) + (eq (char-before + (max (- (match-beginning 0) 2) + (point-min))) + ?,)))))) + ;; (not (memq (char-before (1- (match-beginning 0))) + ;; (list ?\' ?\`))) + )) (let ((unaliased (indirect-function symbol))) (cond ((special-form-p unaliased) (setq emacs-lisp-face 'font-lock-constant-face)) -- cgit v1.2.3-18-g5258