 	      jit-lock-stealth-time 16
 	      jit-lock-contextually t
 	      jit-lock-stealth-nice 0.5
-	      font-lock-maximum-decoration 1)
+	      jit-lock-stealth-load nil
+	      jit-lock-stealth-time 0.5
+	      jit-lock-chunk-size 200
+	      ;; Below: jit-lock-defer-time "pauses" fontification while the
+	      ;; user is typing, as long as the time between successive
+	      ;; keystrokes is <jit-lock-defer-time. This is what makes typing
+	      ;; smooth even with some heavy font locking (because the font
+	      ;; locking will occur during "idle" times)!
+	      jit-lock-defer-time 0.25
+	      font-lock-maximum-decoration t)
 
 ;;;###autoload
 (defun danylo/modeline-setup ()

;;;; Custom minor mode to highlight LaTeX equations

;;;###autoload
(define-minor-mode danylo/latex-font-lock-mode
  "LaTeX equation font locking."
  :lighter " danylo-latex-highlight"
  (mapcar
   (lambda (arg)
     (font-lock-add-keywords
      nil `((,(format "\\(?:%s\\)" arg)
	     (0 'danylo/latex-equation-face-faded t)))))
   '("\\$"
     "\\\\\\(?:begin\\|end\\){equation[\\*]?}"
     "\\\\\\(?:begin\\|end\\){align[\\*]?}"
     "\\\\\\(?:begin\\|end\\){alignat[\\*]?}"
     "\\\\\\(?:begin\\|end\\){gather[\\*]?}"
     "\\\\\\(?:begin\\|end\\){subequations[\\*]?}"
     "\\\\\\(?:begin\\|end\\){multline[\\*]?}"
     "\\\\\\(?:begin\\|end\\){optimization[\\*]?}"
     )))

;;; ..:: Syntax checking ::..


			 (add-to-list 'helm-completing-read-handlers-alist
				      '(LaTeX-environment
					. helm-completing-read-default-handler))
			 )))
  :init (setq TeX-source-correlate-method 'synctex
	      TeX-source-correlate-start-server t
