all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How (efficient) highlight occurrence of 16 same chars?
@ 2010-09-13  8:13 Oleksandr Gavenko
  2010-09-13  8:19 ` Oleksandr Gavenko
  2010-09-13  8:54 ` Deniz Dogan
  0 siblings, 2 replies; 3+ messages in thread
From: Oleksandr Gavenko @ 2010-09-13  8:13 UTC (permalink / raw)
  To: help-gnu-emacs

This code not work:

(font-lock-add-keywords
  'c-mode
  '(
    ("\\(.\\)\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1" 0 
'font-lock-warning-face t)
    ))

I think back reference not worked.




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

* Re: How (efficient) highlight occurrence of 16 same chars?
  2010-09-13  8:13 How (efficient) highlight occurrence of 16 same chars? Oleksandr Gavenko
@ 2010-09-13  8:19 ` Oleksandr Gavenko
  2010-09-13  8:54 ` Deniz Dogan
  1 sibling, 0 replies; 3+ messages in thread
From: Oleksandr Gavenko @ 2010-09-13  8:19 UTC (permalink / raw)
  To: help-gnu-emacs

On 13.09.2010 11:13, Oleksandr Gavenko wrote:
> This code not work:
>
> (font-lock-add-keywords
> 'c-mode
> '(
> ("\\(.\\)\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1" 0
> 'font-lock-warning-face t)
> ))
>
> I think back reference not worked.
>
Oh! I forget that \\(.\\) also take in count. So match 17 not 16.




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

* Re: How (efficient) highlight occurrence of 16 same chars?
  2010-09-13  8:13 How (efficient) highlight occurrence of 16 same chars? Oleksandr Gavenko
  2010-09-13  8:19 ` Oleksandr Gavenko
@ 2010-09-13  8:54 ` Deniz Dogan
  1 sibling, 0 replies; 3+ messages in thread
From: Deniz Dogan @ 2010-09-13  8:54 UTC (permalink / raw)
  To: Oleksandr Gavenko; +Cc: help-gnu-emacs

2010/9/13 Oleksandr Gavenko <gavenko@bifit.com.ua>:
> This code not work:
>
> (font-lock-add-keywords
>  'c-mode
>  '(
>   ("\\(.\\)\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1\\1" 0
> 'font-lock-warning-face t)
>   ))
>
> I think back reference not worked.
>
>
>

This seems to work for me:

(font-lock-add-keywords 'c-mode '(("\\(.\\)\\1\\{15\\}" 0
'font-lock-warning-face t)))

-- 
Deniz Dogan



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

end of thread, other threads:[~2010-09-13  8:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-13  8:13 How (efficient) highlight occurrence of 16 same chars? Oleksandr Gavenko
2010-09-13  8:19 ` Oleksandr Gavenko
2010-09-13  8:54 ` Deniz Dogan

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.