unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: David C Sterratt <david.c.sterratt@ed.ac.uk>
Subject: Re: Font-lock with newcomment.el
Date: 02 Jun 2003 11:06:01 +0100	[thread overview]
Message-ID: <eyu4r38equu.fsf@canonmills.inf.ed.ac.uk> (raw)
In-Reply-To: 3ED78597.1060500@yahoo.com

>>>>> Kevin Rodgers writes:

 > 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 how looking-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) ...).

Thanks for the advice.  I may have to save it for a  rainy day, as
I've got too much to do at the moment, but when I'm feeling like a
bit more elisp hacking I'll take a look at the indentation code
again.

David.

  reply	other threads:[~2003-06-02 10:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-29 16:07 Font-lock with newcomment.el David C Sterratt
2003-05-29 17:22 ` lawrence mitchell
2003-05-29 17:31 ` Stefan Monnier
2003-05-30 11:12   ` David C Sterratt
2003-05-30 11:45     ` lawrence mitchell
2003-05-30 13:57       ` Stefan Monnier
2003-05-30 15:20         ` David C Sterratt
2003-05-30 16:23           ` Kevin Rodgers
2003-06-02 10:06             ` David C Sterratt [this message]
2003-05-30 16:34           ` Stefan Monnier
2003-05-30 15:02       ` David C Sterratt

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=eyu4r38equu.fsf@canonmills.inf.ed.ac.uk \
    --to=david.c.sterratt@ed.ac.uk \
    /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.
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).