Skip to content

Commit

Permalink
nit(elisp): minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Mar 29, 2023
1 parent 2f9809a commit bf3a4e0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions modules/extras/me-elisp-extras.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

(defvar +emacs-lisp--face nil)

;; Extracted from github.com/doomemacs/doomemacs/blob/master/modules/lang/emacs-lisp/autoload.el
;; Extracted from: github.com/doomemacs/doomemacs/blob/master/modules/lang/emacs-lisp/autoload.el
(defun +emacs-lisp--highlight-vars-and-faces (end)
"Match defined variables and functions.
Functions are differentiated into special forms, built-in functions and
Expand Down Expand Up @@ -43,7 +43,7 @@ library/userland functions"
(throw 'matcher t)))))))
nil))

;; Taken from reddit.com/r/emacs/comments/d7x7x8/finally_fixing_indentation_of_quoted_lists/
;; Taken from: reddit.com/r/emacs/comments/d7x7x8/finally_fixing_indentation_of_quoted_lists
(defun +emacs-lisp--calculate-lisp-indent-a (&optional parse-start)
"Add better indentation for quoted and backquoted lists."
;; This line because `calculate-lisp-indent-last-sexp` was defined with `defvar`
Expand Down Expand Up @@ -219,15 +219,14 @@ library/userland functions"
normal-indent))))))

(defun +elisp-indent-setup ()
;; Fixed indenter that intends plists sensibly.
(advice-add #'calculate-lisp-indent :override
#'+emacs-lisp--calculate-lisp-indent-a))
;; Override the indenter to indent plists correctly.
;; See: reddit.com/r/emacs/comments/d7x7x8/finally_fixing_indentation_of_quoted_lists/
(advice-add 'calculate-lisp-indent :override #'+emacs-lisp--calculate-lisp-indent-a))

(defun +elisp-highlighting-setup ()
;; Fixed indenter that intends plists sensibly.
(font-lock-add-keywords
'emacs-lisp-mode
`((+emacs-lisp--highlight-vars-and-faces . +emacs-lisp--face))))
'((+emacs-lisp--highlight-vars-and-faces . +emacs-lisp--face))))

;; HACK: Adapted from Doom. Quite a few functions here are called often, and so
;; are especially performance sensitive, so we compile these functions
Expand Down

0 comments on commit bf3a4e0

Please sign in to comment.