diff options
author | David Aspinall <da@inf.ed.ac.uk> | 1999-11-15 15:07:47 +0000 |
---|---|---|
committer | David Aspinall <da@inf.ed.ac.uk> | 1999-11-15 15:07:47 +0000 |
commit | 565d054abec753b8235ef001f3d608822d88d0bc (patch) | |
tree | 1e798658857c0a3e17340b6f8a368fd488fc2574 /generic/proof.el | |
parent | e5b83b5797320fdaedd7d381ec7686dbda6d143f (diff) |
Some new macros. FSF fix for font-lock. Failed attempt not to turn on font-lock everywhere.
Diffstat (limited to 'generic/proof.el')
-rw-r--r-- | generic/proof.el | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/generic/proof.el b/generic/proof.el index adeac019..b46ec6c2 100644 --- a/generic/proof.el +++ b/generic/proof.el @@ -35,6 +35,7 @@ (autoload 'browse-url "browse-url" "Ask a WWW browser to load URL." t)) +;; These are internal functions of font-lock (autoload 'font-lock-fontify-region "font-lock") (autoload 'font-lock-append-text-property "font-lock") @@ -171,6 +172,11 @@ of the proof (starting from 1).") (with-current-buffer ,buf ,@body))) +(defmacro proof-map-buffers (buflist &rest body) + "Do BODY on each buffer in BUFLIST, if it exists." + `(dolist (buf ,buflist) + (proof-with-current-buffer-if-exists buf ,@body))) + (defmacro proof-customize-toggle (var) "Make a function for toggling a boolean customize setting VAR." `(lambda (arg) @@ -267,13 +273,23 @@ with extra patterns (in non-mule mode).") ;; edits font-lock-keywords and loses the setting. So we make a ;; copy of it in a new local variable, proof-font-lock-defaults. ;; - ;(make-local-variable 'font-lock-defaults) ; not needed in XEmacs, FSF? + (make-local-variable 'font-lock-defaults) ; not needed in XEmacs, FSF? (setq proof-font-lock-defaults font-lock-keywords) (setq font-lock-keywords-case-fold-search case-fold) ;; Setting font-lock-defaults explicitly is required by FSF Emacs ;; 20.4's version of font-lock in any case. - (setq font-lock-defaults `(proof-font-lock-defaults nil ,case-fold))) - + (setq font-lock-defaults `(proof-font-lock-defaults nil ,case-fold)) + ;; FIXME: font-lock turned on somewhere, where? + (setq font-lock-keywords nil)) + +(defun proof-font-lock-fontify-region (start end) + "font-lock-fontify-region doesn't work for FSF Emacs 20.4, sigh." + (if (string-match "XEmacs" emacs-version) + (font-lock-fontify-region start end) + ;; This version is very noisy. Hopefully it's okay because we + ;; do a narrow-to-region below, so whole buffer appears to + ;; be the region we want. + (font-lock-fontify-buffer))) (defun proof-fontify-region (start end) "Fontify and decode X-Symbols in region START...END. @@ -292,8 +308,7 @@ Returns new END value." (narrow-to-region start end) (if proof-output-fontify-enable (let ((font-lock-keywords proof-font-lock-defaults)) - ; fontify-region doesn't work for FSF Emacs 20.4, sigh. - (font-lock-fontify-region start end) + (proof-font-lock-fontify-region start end) ; has annoying messages ; (font-lock-fontify-buffer) ; hope okay cos narrow region. ;; FIXME: this should be optional, really. |