chiark / gitweb /
el/dot-emacs.el: Add hacking for LaTeX syntax highlighting.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 25 Jun 2017 18:03:20 +0000 (19:03 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 25 Jun 2017 18:03:20 +0000 (19:03 +0100)
el/dot-emacs.el

index d83057a9880827fc61a9145e485494bd6e89e718..59c85364063770bdd4c47cd86f393c168774afcd 100644 (file)
@@ -3109,6 +3109,25 @@ (defun mdw-fontify-tex ()
         (list "[$^_{}#&]"
               '(0 mdw-punct-face)))))
 
+(eval-after-load 'font-latex
+  '(defun font-latex-jit-lock-force-redisplay (buf start end)
+     "Compatibility for Emacsen not offering `jit-lock-force-redisplay'."
+     ;; The following block is an expansion of `jit-lock-force-redisplay'
+     ;; and involved macros taken from CVS Emacs on 2007-04-28.
+     (with-current-buffer buf
+       (let ((modified (buffer-modified-p)))
+        (unwind-protect
+            (let ((buffer-undo-list t)
+                  (inhibit-read-only t)
+                  (inhibit-point-motion-hooks t)
+                  (inhibit-modification-hooks t)
+                  deactivate-mark
+                  buffer-file-name
+                  buffer-file-truename)
+              (put-text-property start end 'fontified t))
+          (unless modified
+            (restore-buffer-modified-p nil)))))))
+
 ;;;--------------------------------------------------------------------------
 ;;; SGML hacking.