help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regex Problem => "overlapping words"


From: Tim Johnson
Subject: Re: Regex Problem => "overlapping words"
Date: Sun, 4 Dec 2005 08:13:59 -0900
User-agent: Mutt/1.4.2.1i

* Stefan Monnier <monnier@iro.umontreal.ca> [051204 07:22]:
> >> Take a look at the place where font-lock-defaults is set.
> >> Then look at the docstring of font-lock-defaults.
> >> Then locate the SYNTAX-ALIST element and set it so that the character ?-
> >> has syntax "w".
> 
> >     Thanks Stefan: Below are the two elisp forms that contain the symbol
> >     'font-lock-defaults:
> >      (make-local-variable 'font-lock-defaults)
> >      (setq font-lock-defaults '(rebol-font-lock-keywords nil nil))
> 
> >      ;; there does not appear to be a docstring and there is no
> >      ;; symbol syntax-alist (or SYNTAX-ALIST) in the mode file
> 
> I must say I don't understand your message.
   
    Sorry ...

> It seems you managed the first step (finding the place where
> font-lock-defaults is set).  
> Have you managed to do the second step (look at the docstring of 
> font-lock-defaults)?  

  There is none that I can find. Where else would I look? There is no
  other references in the file.

> What about the third?
      
  What I stated in my message is that from all appearances, the hyphen
  *IS* properly contained in the syntax table. 
  
  The substrings above can actually be in two different font-lock groups
  depending on whether or not they are used to create a subroutine and
  are preceded by a colon. (Please see the regex).

  Two test, I placed "def" in another font-lock group.
  (rebol-user-functions) Now when 
  I type in "def" *without* a preceding colon, it is highlighted as per
  of the 'rebol-user-functions group. If I then type a hyphen, so we
  have "def-" the highlight is disabled. CORRECT.

  Now, if I type in "def" following the colon, it is first highlighted
  as per 'rebol-user-functions. *Then*, if I add a hyphen, the
  highlighting for the "def" substring changes to the color of
  'font-lock-keyword-face AND the color of the hyphen and every
  character following it is "painted" the 'default color. WRONG.

  =======================================================================
   This suggests to me that my regex is still lacking something, and the
   problem is probably *not* in the syntax table.
  =======================================================================

  I appreciate your help, but this is no big deal. Does not effect
  functionality. 

  Thank you very much.
  tim

> 
>         Stefan
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]