Robert Goldman
unread,May 10, 2013, 3:15:15 PM5/10/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to auctex...@gnu.org, David Reitter, Development of Aquamacs Emacs
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)))))))