[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] Proposed patch to font-latex-jit-lock-force-redisplay
From: |
Robert Goldman |
Subject: |
[AUCTeX-devel] Proposed patch to font-latex-jit-lock-force-redisplay |
Date: |
Fri, 10 May 2013 14:15:15 -0500 |
User-agent: |
Postbox 3.0.8 (Macintosh/20130427) |
Below is a patch to this program that, for me, fixes the problem calling
jit-lock-force-redisplay in Aquamacs 3, which is built on Emacs 24.
I see two problems with this fix:
1. It's inelegant. The marker manufacturing I'm doing here just seems
wrong.
2. It may have backward compatibility issues. From my inspection of
the jit-lock-force-redisplay code, it looked to me like the function
might have changed recently. If this is the case, the following might
need some additional magic to protect against different versions of
jit-lock-force-redisplay. I don't know enough about this code to
provide that.
(defun font-latex-jit-lock-force-redisplay (buf start end)
"Compatibility for Emacsen not offering `jit-lock-force-redisplay'."
(if (fboundp 'jit-lock-force-redisplay)
(let ((m1 (make-marker))
(m2 (make-marker)))
(save-current-buffer
(set-buffer buf)
(set-marker m1 start)
(set-marker m2 end)))
(jit-lock-force-redisplay m1 m2))
;; 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)))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [AUCTeX-devel] Proposed patch to font-latex-jit-lock-force-redisplay,
Robert Goldman <=