|
From: | Kevin Rodgers |
Subject: | Re: Font-lock with newcomment.el |
Date: | Fri, 30 May 2003 10:23:51 -0600 |
User-agent: | Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
David C Sterratt wrote:
Stefan Monnier writes:> Oh, and David, regarding your mode: do a C-h f looking-at, that > will save you a bunch of buffer-substrings. Thanks for looking at the code. From the looking-at documentation, it seems like it only matches regexps after the point, whereas in the current way of doing indentation I need to match symbols anywhere in the line, in most cases at least. So it's not clear to me howlooking-at will help, unless I rethink the indentation code.
I don't have your code in front of me, but it sounds like you're using buffer-substring to extract the current line and then string-match to recognize a pattern in it. Since looking-at only matches its REGEXP argument immediately after point, you can search for any pattern on the current line with (concat ".*" REGEXP), assuming you're at the beginning of the line -- if not, just wrap it in (save-excursion (beginning-of-line) ...). -- <a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
[Prev in Thread] | Current Thread | [Next in Thread] |