* David Kastrup (2005-10-11) writes:
> Surendra Singhi <[EMAIL PROTECTED]> writes:
>
>> Dear Bug Team,
>> AuCTeX messes up syntax highlighting of text in the verbatim
>> section. for example in the code fragment given below, the lines
>> beginnning with % in the verbatim section are not comments but AuCTex
>> still colors them as if they are comment.
>>
>> Emacs : XEmacs 21.5 (beta22) "cucumber" (+CVS-20051003) [Lucid]
>> (i586-pc-win32) of Tue Oct 04 2005 on THAR
>> Package: AUCTeX CVS-1.13 (2005-02-11)
>
> Let's wait for Ralf to corroborate, but I guess that this already says
> all: the font locking capabilities of XEmacs remain inferior to Emacs.
At least the capabilities of XEmacs 21.4. I have a patch for
activating syntactic font locking of verbatim environments in XEmacs
(attached to this mail if somebody wants to play with it), but this
leads to more problems in XEmacs 21.4 than just leaving verbatim
environments untreated. (I don't recall which ones those were exactly
now.) It could be that XEmacs 21.5 can handle this. I haven't
checked that. It would have to meet the requirements I described in
<URL:http://mid.gmane.org/[EMAIL PROTECTED]> on xemacs-beta.
> Ralf, any news with regard to a precompiled CVS Emacs including
> AUCTeX?
I am still unsure how to handle the image libraries wrt to providing
source code. The Emacs from nqmacs.sf.net simply includes a README
file referring to the GnuWin32 project. I don't know if this would be
enough. If it isn't, I don't know if I can just put the source code
found at the GnuWin32 project into a src directory for download
besides the compiled Emacs. Is there somebody we can ask at gnu.org?
Does anybody know how the GNU project intends to handle this once
Emacs 22 will be released?
--
Ralf
Index: font-latex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/font-latex.el,v
retrieving revision 5.141
diff -u -r5.141 font-latex.el
--- font-latex.el 2 Oct 2005 13:19:48 -0000 5.141
+++ font-latex.el 11 Oct 2005 09:46:02 -0000
@@ -706,10 +707,11 @@
(add-to-list 'font-latex-syntactic-keywords
`(,(concat "^[ \t]*\\\\begin *{\\(?:" verb-envs
"\\)}.*\\(\n\\)")
- (1 "|" t)))
+ ;; XXX: Is there a better feature test?
+ ,(if (featurep 'xemacs) '(1 (7)) '(1 "|" t))))
(add-to-list 'font-latex-syntactic-keywords
`(,(concat "\\(\n\\)[ \t]*\\\\end *{\\(?:" verb-envs "\\)}")
- (1 "|" t))))
+ ,(if (featurep 'xemacs) '(1 (7)) '(1 "|" t)))))
(unless (= (length verb-macros-with-delims) 0)
(add-to-list 'font-latex-syntactic-keywords
`(,(concat "\\\\\\(?:" verb-macros-with-delims "\\)"
@@ -723,12 +725,15 @@
;; Prevents wrong fontification of stuff
;; like "\verb|foo\|".
"\\(" (regexp-quote TeX-esc) "*\\)\\(\\1\\)")
- (1 "\"") (2 ".") (3 "\""))))
+ ,(if (featurep 'xemacs) '(1 (7)) '(1 "\""))
+ ,(if (featurep 'xemacs) '(2 (1)) '(2 "."))
+ ,(if (featurep 'xemacs) '(3 (7)) '(3 "\"")))))
(unless (= (length verb-macros-with-braces) 0)
(add-to-list 'font-latex-syntactic-keywords
`(,(concat "\\\\\\(?:" verb-macros-with-braces "\\)"
"\\({\\).*?[^\\]\\(?:\\\\\\\\\\)*\\(}\\)")
- (1 "|") (2 "|")))))
+ ,(if (featurep 'xemacs) '(1 (7)) '(1 "|"))
+ ,(if (featurep 'xemacs) '(2 (7)) '(2 "|"))))))
;; Cater for docTeX mode.
(setq font-latex-doctex-syntactic-keywords
(append font-latex-syntactic-keywords
@@ -941,36 +956,49 @@
;; well, remove the call to `TeX-install-font-lock' from
;; `VirTeX-common-initialization' and place it in the different
;; `xxx-mode' calls instead, but _after_ `major-mode' is set.
- (cond
- ((eq major-mode 'doctex-mode)
- (setq font-lock-defaults
- '((font-latex-keywords font-latex-keywords-1 font-latex-keywords-2
- font-latex-doctex-keywords)
- nil nil ((?\( . ".") (?\) . ".") (?$ . "\"")) nil
- (font-lock-comment-start-regexp . "%")
- (font-lock-mark-block-function . mark-paragraph)
- (font-lock-unfontify-region-function
- . font-latex-unfontify-region)
- (font-lock-syntactic-face-function
- . font-latex-doctex-syntactic-face-function)
- (font-lock-syntactic-keywords
- . font-latex-doctex-syntactic-keywords))))
- (t
- (setq font-lock-defaults
- '((font-latex-keywords font-latex-keywords-1 font-latex-keywords-2)
- nil nil ((?\( . ".") (?\) . ".") (?$ . "\"")) nil
- (font-lock-comment-start-regexp . "%")
- (font-lock-mark-block-function . mark-paragraph)
- (font-lock-unfontify-region-function
- . font-latex-unfontify-region)
- (font-lock-syntactic-face-function
- . font-latex-syntactic-face-function)
- (font-lock-syntactic-keywords
- . font-latex-syntactic-keywords))))))
+ (let ((defaults
+ '((font-latex-keywords font-latex-keywords-1 font-latex-keywords-2)
+ nil nil ((?\( . ".") (?\) . ".") (?$ . "\"")) nil))
+ (variables
+ '((font-lock-comment-start-regexp . "%")
+ (font-lock-mark-block-function . mark-paragraph)
+ (font-lock-unfontify-region-function
+ . font-latex-unfontify-region))))
+ ;; Add the mode-dependent stuff to the basic variables defined above.
+ (if (eq major-mode 'doctex-mode)
+ (progn
+ (setcar defaults (append (car defaults)
+ '(font-latex-doctex-keywords)))
+ (setq variables
+ (append variables
+ '((font-lock-syntactic-face-function
+ . font-latex-doctex-syntactic-face-function)
+ (font-lock-syntactic-keywords
+ . font-latex-doctex-syntactic-keywords)))))
+ (setq variables
+ (append variables
+ '((font-lock-syntactic-face-function
+ . font-latex-syntactic-face-function)
+ (font-lock-syntactic-keywords
+ . font-latex-syntactic-keywords)))))
+ ;; Cater for the idiosyncrasies of Emacs and XEmacs.
+ (if (featurep 'xemacs)
+ (progn
+ ;; XEmacs does not set these variables via `font-lock-defaults'
+ ;; but requires them to be set explicitely.
+ (mapcar (lambda (alist)
+ (set (car alist) (cdr alist))) variables)
+ ;; Has to be set to t as otherwise syntax properties will not be
+ ;; be picked up during fontification.
+ (set (make-local-variable 'lookup-syntax-properties) t))
+ (setq defaults (append defaults variables)))
+ ;; Set the defaults.
+ (setq font-lock-defaults defaults)))
;; Copy and adaption of `tex-font-lock-unfontify-region' from
;; tex-mode.el in GNU Emacs on 2004-08-04.
-(defun font-latex-unfontify-region (beg end)
+;; (XEmacs passes a third argument to the function.)
+(defun font-latex-unfontify-region (beg end &rest ignore)
"Unfontify region from BEG to END."
(font-lock-default-unfontify-region beg end)
(while (< beg end)
_______________________________________________
bug-auctex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-auctex