diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-04-15 16:50:17 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-04-15 16:50:17 -0400 |
commit | c0c57f8b36d4472296f9bc237a16b9876488472c (patch) | |
tree | 12cb956e9134fd8567991c2e8502e0c7f2ae9ea0 /lisp/progmodes | |
parent | 59fd76c178ada8a8b3eb5e3e00609001e9f0195f (diff) | |
download | emacs-c0c57f8b36d4472296f9bc237a16b9876488472c.tar.gz |
Move some Elisp-specific code from lisp-mode.el to elisp-mode.el
* lisp/emacs-lisp/lisp-mode.el (lisp--el-font-lock-flush-elisp-buffers):
Move to elisp-mode.el.
(lisp-mode-variables): (Re)move elisp-specific settings.
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add settings removed
from lisp-mode-variables.
(elisp--font-lock-flush-elisp-buffers): New function, moved from
lisp-mode.el.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/elisp-mode.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 29f1ee9a98c..29f1c9aeb6b 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -230,6 +230,9 @@ Blank lines separate paragraphs. Semicolons start comments. (defvar xref-find-function) (defvar xref-identifier-completion-table-function) (lisp-mode-variables nil nil 'elisp) + (add-hook 'after-load-functions #'elisp--font-lock-flush-elisp-buffers) + (setq-local electric-pair-text-pairs + (cons '(?\` . ?\') electric-pair-text-pairs)) (setq imenu-case-fold-search nil) (add-function :before-until (local 'eldoc-documentation-function) #'elisp-eldoc-documentation-function) @@ -239,6 +242,24 @@ Blank lines separate paragraphs. Semicolons start comments. (add-hook 'completion-at-point-functions #'elisp-completion-at-point nil 'local)) +;; Font-locking support. + +(defun elisp--font-lock-flush-elisp-buffers (&optional file) + ;; FIXME: Aren't we only ever called from after-load-functions? + ;; Don't flush during load unless called from after-load-functions. + ;; In that case, FILE is non-nil. It's somehow strange that + ;; load-in-progress is t when an after-load-function is called since + ;; that should run *after* the load... + (when (or (not load-in-progress) file) + ;; FIXME: If the loaded file did not define any macros, there shouldn't + ;; be any need to font-lock-flush all the Elisp buffers. + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (derived-mode-p 'emacs-lisp-mode) + ;; So as to take into account new macros that may have been defined + ;; by the just-loaded file. + (font-lock-flush)))))) + ;;; Completion at point for Elisp (defun elisp--local-variables-1 (vars sexp) |