all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* CC Mode 5.31.3 (C/l); defined not emphasised
@ 2006-03-13 14:27 Peter Dyballa
  2006-03-13 17:08 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Dyballa @ 2006-03-13 14:27 UTC (permalink / raw)


Hello!

In a patched version of xv.h I have:

	/* lots of things don't have <malloc.h> */
	/* A/UX systems include it from stdlib, from Xos.h */
	#ifndef VMS   /* VMS hates multi-line '#if's */
	# if !defined(ibm032)                    && \
	     !defined(__convex__)                && \
	     !(defined(vax) && !defined(ultrix)) && \
	     !defined(mips)                      && \
	     !defined(apollo)                    && \
	     !defined(pyr)                       && \
	     !defined(__UMAXV__)                 && \
	     !defined(bsd43)                     && \
	     !defined(aux)                       && \
	     !defined(__bsdi__)                  && \
	     !defined(sequent)                   && \
	     !defined(__FreeBSD__)               && \
	     !defined(__OpenBSD__)
	
	#  if defined(hp300) || defined(hp800) || defined(NeXT)
	#   include <sys/malloc.h>                /* it's in 'sys' on HPs  
and NeXT */
	#  else
	#   include <malloc.h>
	#  endif
	# endif
	#endif /* !VMS */

In this example only the first seven 'defined' (up to and including  
defined(pyr)) are emphasised with font-lock-preprocessor-face, then  
again those in the '#  if defined(hp300)' line. Alan Mackenzie  
explained that this is due to "problem with jit-lock-mode, which  
doesn't cope very well with language constructs which extend over  
several lines.  You can see this by
disabling jit-lock-mode with (setq font-lock-support-mode nil), after  
which the entire file fontifies properly." The last observation I can  
make, too. My set-up is:

	(cond ((fboundp 'global-font-lock-mode)
	   ;; Turn on font-lock in all modes that support it
	   (global-font-lock-mode 1)
	;   (setq font-lock-multiline 'undecided')
	   (setq jit-lock-stealth-verbose t)
	   (setq jit-lock-mode t)
	;   (setq jit-lock-stealth-load 80)
	   ;; Maximum colors
	   (setq font-lock-maximum-decoration t)))

and

	'(font-lock-beginning-of-syntax-function nil t)
	'(font-lock-global-modes (quote (not)))
	'(font-lock-keywords-case-fold-search nil t)
	'(font-lock-keywords-only nil t)
	'(font-lock-mark-block-function nil t)
	'(font-lock-maximum-decoration t)
	'(global-font-lock-mode t nil (font-core))


--
Greetings

   Pete

Windows, c'est un peu comme le beaujolais nouveau: à chaque nouvelle  
cuvée on sait que ce sera dégueulasse, mais on en prend quand même,  
par masochisme.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: CC Mode 5.31.3 (C/l); defined not emphasised
  2006-03-13 14:27 CC Mode 5.31.3 (C/l); defined not emphasised Peter Dyballa
@ 2006-03-13 17:08 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2006-03-13 17:08 UTC (permalink / raw)
  Cc: emacs-devel

> In this example only the first seven 'defined' (up to and including
> defined(pyr)) are emphasised with font-lock-preprocessor-face, then  again
> those in the '#  if defined(hp300)' line. Alan Mackenzie  explained that
> this is due to "problem with jit-lock-mode, which  doesn't cope very well
> with language constructs which extend over  several lines.  You can see
> this by disabling jit-lock-mode with (setq font-lock-support-mode nil),
> after  which the entire file fontifies properly." The last observation

Even without jit-lock, the same problem manifests itself if you go to the
4th `defined' and change the line: only that lines gets refontified by
font-lock and cc-mode's font-lock patterns isn't careful to look back
far enough to rehighlight properly.

I.e. the problem is not in jit-lock but in cc-mode.
(or in font-lock's general lack of support for multiline patterns).

Maybe cc-mode could use the font-lock-multiline property to good
effect here.


        Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-13 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-13 14:27 CC Mode 5.31.3 (C/l); defined not emphasised Peter Dyballa
2006-03-13 17:08 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.