unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
Cc: bug-cc-mode@gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: font-locking and open parens in column zero
Date: Sat, 23 Sep 2006 16:55:03 +0200	[thread overview]
Message-ID: <45154AC7.5070209@gmx.at> (raw)
In-Reply-To: <E1GQyHX-0005PU-HC@fencepost.gnu.org>

 > 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.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


  reply	other threads:[~2006-09-23 14:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-10 10:09 font-locking and open parens in column zero martin rudalics
2006-09-10 18:52 ` Richard Stallman
2006-09-11 13:05   ` martin rudalics
2006-09-11 14:18     ` Stefan Monnier
2006-09-12  2:01     ` Richard Stallman
2006-09-14  8:41       ` martin rudalics
2006-09-17 15:12         ` Richard Stallman
2006-09-17 21:13           ` martin rudalics
2006-09-18 23:40             ` Richard Stallman
2006-09-19  9:00               ` martin rudalics
2006-09-23  3:34                 ` Richard Stallman
2006-09-23 14:55                   ` martin rudalics [this message]
2006-09-24  2:10                     ` Richard Stallman
2006-09-24  9:42                       ` martin rudalics
2006-09-25  0:46                         ` Stefan Monnier
2006-09-25  8:05                           ` martin rudalics
2006-09-25  3:17                         ` Richard Stallman
2006-09-25  8:10                           ` martin rudalics
2006-09-10 19:26 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45154AC7.5070209@gmx.at \
    --to=rudalics@gmx.at \
    --cc=bug-cc-mode@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).