[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: font-locking and open parens in column zero
From: |
martin rudalics |
Subject: |
Re: font-locking and open parens in column zero |
Date: |
Sat, 23 Sep 2006 16:55:03 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> What would you think of something like this?
>
> *** font-lock.el 16 Sep 2006 13:50:14 -0400 1.306
> --- font-lock.el 22 Sep 2006 17:29:23 -0400
> ***************
> *** 1646,1654 ****
> (cons t (cons keywords
> (mapcar 'font-lock-compile-keyword keywords))))
> (if (and (not syntactic-keywords)
> ! (eq (or syntax-begin-function
> ! font-lock-beginning-of-syntax-function)
> ! 'beginning-of-defun)
> (not beginning-of-defun-function))
> ;; Try to detect when a string or comment contains something that
> ;; looks like a defun and would thus confuse font-lock.
> --- 1646,1656 ----
> (cons t (cons keywords
> (mapcar 'font-lock-compile-keyword keywords))))
> (if (and (not syntactic-keywords)
> ! (let ((beg-function
> ! (or syntax-begin-function
> ! font-lock-beginning-of-syntax-function)))
> ! (or (eq beg-function 'beginning-of-defun)
> ! (get beginning-of-defun 'font-lock-syntax-paren-check)))
> (not beginning-of-defun-function))
> ;; Try to detect when a string or comment contains something that
> ;; looks like a defun and would thus confuse font-lock.
We presume that major modes that introduce conflicting settings for
`syntax-begin-function' and `font-lock-beginning-of-syntax-function' are
on their own? In any case, `beginning-of-defun' is not buffer-local.
Hence, I'd prefer something like:
*** font-lock.el Sat Sep 23 11:08:56 2006 1.306
--- font-lock.el Sat Sep 23 16:32:08 2006
***************
*** 1646,1654 ****
(cons t (cons keywords
(mapcar 'font-lock-compile-keyword keywords))))
(if (and (not syntactic-keywords)
! (eq (or syntax-begin-function
! font-lock-beginning-of-syntax-function)
! 'beginning-of-defun)
(not beginning-of-defun-function))
;; Try to detect when a string or comment contains something that
;; looks like a defun and would thus confuse font-lock.
--- 1646,1656 ----
(cons t (cons keywords
(mapcar 'font-lock-compile-keyword keywords))))
(if (and (not syntactic-keywords)
! (let ((beg-function
! (or 'syntax-begin-function
! 'font-lock-beginning-of-syntax-function)))
! (or (eq (eval beg-function) 'beginning-of-defun)
! (get beg-function 'font-lock-syntax-paren-check)))
(not beginning-of-defun-function))
;; Try to detect when a string or comment contains something that
;; looks like a defun and would thus confuse font-lock.
- Re: font-locking and open parens in column zero, (continued)
- Re: font-locking and open parens in column zero, Richard Stallman, 2006/09/10
- Re: font-locking and open parens in column zero, martin rudalics, 2006/09/11
- Re: font-locking and open parens in column zero, Stefan Monnier, 2006/09/11
- Re: font-locking and open parens in column zero, Richard Stallman, 2006/09/11
- Re: font-locking and open parens in column zero, martin rudalics, 2006/09/14
- Re: font-locking and open parens in column zero, Richard Stallman, 2006/09/17
- Re: font-locking and open parens in column zero, martin rudalics, 2006/09/17
- Re: font-locking and open parens in column zero, Richard Stallman, 2006/09/18
- Re: font-locking and open parens in column zero, martin rudalics, 2006/09/19
- Re: font-locking and open parens in column zero, Richard Stallman, 2006/09/22
- Re: font-locking and open parens in column zero,
martin rudalics <=
- Re: font-locking and open parens in column zero, Richard Stallman, 2006/09/23
- Re: font-locking and open parens in column zero, martin rudalics, 2006/09/24
- Re: font-locking and open parens in column zero, Stefan Monnier, 2006/09/24
- Re: font-locking and open parens in column zero, martin rudalics, 2006/09/25
- Re: font-locking and open parens in column zero, Richard Stallman, 2006/09/24
- Re: font-locking and open parens in column zero, martin rudalics, 2006/09/25
Re: font-locking and open parens in column zero, Stefan Monnier, 2006/09/10