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

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

What's a better regexp for 'sentence-end' variable??


From: gebser
Subject: What's a better regexp for 'sentence-end' variable??
Date: Tue, 18 Feb 2003 08:16:26 -0500 (EST)

Hello, all, 

Happy snowstorm!

This problem has required some thought and, frankly,I don't think it can
be done-- not without some considerable rewriting of elisp code.

Because I do considerable editing of html and similar types of files, I
wanted to add to the standard definition of "sentence-end". I.e., I
wanted emacs to consider an end of sentence such character sequences
which have ".", "?", or "!" when they are followed by either a "<" or
">".

The standard end-of-sentence variable is defined as:

(defcustom sentence-end (purecopy "[.?!][]\"')}]*\\($\\| $\\|\t\\|  \\)[ 
\t\n]*")

Initially I thought that just adding the "<" and ">" characters would do
it.  I.e.:

(defcustom sentence-end (purecopy "[.?!][]\<>\"')}]*\\($\\| $\\|\t\\|  
\\)[ \t\n]*")

(the above should be all on one line) would do this.  It doesn't because
I want the cursor to land on top of the ">" or "<" character immediately
after string comprising the standard definition.  That is, given:

end.</p>

hitting M-e would place the cursor after the period.

So what's the proper syntax to have emacs see ".", "!", or "?" (and
other expressions defined by the default "sentence-end variable) as the
end of a sentence when one of them is followed by either the ">" or "<"
characters?

The reason I said that I didn't think this could be done simply is 
because it seems that emacs would have to search and find strings such 
as ".<" or ". <" or "?  <" and then back up a character or two or three.


Hope I've been clear enough.


tia,
ken





reply via email to

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