[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Fwd: Bug in font-latex.el
From: |
Mosè Giordano |
Subject: |
Re: [AUCTeX-devel] Fwd: Bug in font-latex.el |
Date: |
Sun, 12 May 2013 16:32:25 +0200 |
Hi Ralf,
I had committed the fix before your message, this is what I've done:
--8<---------------cut here---------------start------------->8---
--- a/font-latex.el
+++ b/font-latex.el
@@ -1220,8 +1220,6 @@ triggers Font Lock to recognize the change."
(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)
- (jit-lock-force-redisplay buf start end)
;; 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
@@ -1236,7 +1234,7 @@ triggers Font Lock to recognize the change."
buffer-file-truename)
(put-text-property start end 'fontified t))
(unless modified
- (restore-buffer-modified-p nil)))))))
+ (restore-buffer-modified-p nil))))))
(defun font-latex-fontify-region (beg end &optional loudly)
"Fontify region from BEG to END.
--8<---------------cut here---------------end--------------->8---
IIUC you're suggesting to do something like
--8<---------------cut here---------------start------------->8---
--- a/font-latex.el
+++ b/font-latex.el
@@ -1221,7 +1221,10 @@ triggers Font Lock to recognize the change."
(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)
- (jit-lock-force-redisplay buf start end)
+ (condition-case nil
+ (jit-lock-force-redisplay buf start end)
+ (wrong-number-of-arguments
+ (jit-lock-force-redisplay (copy-marker start) (copy-marker end))))
;; 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
--8<---------------cut here---------------end--------------->8---
Is it correct?
Thank you,
Mosè
2013/5/12 Ralf Angeli <address@hidden>:
> * Mosč Giordano (2013-05-12) writes:
>
>> you're right, `jit-lock-force-redisplay' has been recently changed,
>> see http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/112357 Maybe
>> there is a good reason behind the change of arguments number, but I
>> simply don't know it. I can see two solutions:
>> - report this to Emacs and make them restore backward compatibility;
>
> If this is done probably depends on how much the function is seen as
> being for internal use only. Its use in AUCTeX is probably already a
> bit hackish but so is lots of compatibility code.
>
>> - implement `font-latex-jit-lock-force-redisplay' in AUCTeX without
>> relying on possibly existing `jit-lock-force-redisplay'.
>> As a temporary fix, I'm going to change
>> `font-latex-jit-lock-force-redisplay' following the second solution.
>
> Not sure what you have in mind, but we could also use something like the
> following. Not that it is particulary nice.
>
> (condition-case nil
> (jit-lock-force-redisplay buf start end)
> (error
> (jit-lock-force-redisplay (copy-marker start) (copy-marker end))))
>
> --
> Ralf