From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: What's a better regexp for 'sentence-end' variable?? Date: Tue, 18 Feb 2003 15:06:13 +0100 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1045577531 829 80.91.224.249 (18 Feb 2003 14:12:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 18 Feb 2003 14:12:11 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18l8Td-0000CQ-00 for ; Tue, 18 Feb 2003 15:12:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18l8Sp-0004oM-0B for gnu-help-gnu-emacs@m.gmane.org; Tue, 18 Feb 2003 09:11:15 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!fu-berlin.de!uni-berlin.de!dialin-145-254-194-217.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: dialin-145-254-194-217.arcor-ip.net (145.254.194.217) Original-X-Trace: fu-berlin.de 1045577180 50358543 145.254.194.217 (16 [87814]) X-Operating-System: GNU/Linux, built from scratch: http://www.linuxfromscratch.org/ X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-msvc-nt5.1.2600) Cancel-Lock: sha1:CuQDrHczLthDGJdu6Mn0l869AzY= Original-Xref: shelby.stanford.edu gnu.emacs.help:110338 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6840 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6840 gebser@ameritech.net writes: [...] > 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 > ">". [...] > (defcustom sentence-end (purecopy "[.?!][]\<>\"')}]*\\($\\| $\\|\t\\| > \\)[ \t\n]*") What is the `purecopy' in your code good for? You didn't change this in the source code, did you? ;-) [...] > I want the cursor to land on top of the ">" or "<" character immediately > after string comprising the standard definition. That is, given: > > end.

> > hitting M-e would place the cursor after the period. I would do it with a simple bit of Elisp. You could put something like the following into your ~/.emacs: (defun my-html-forward-sentence () (interactive) (save-match-data (if (re-search-forward "\\([.?!]\\)<" nil t) (goto-char (match-end 1)) (goto-char (point-max))))) (define-key sgml-mode-map (kbd "M-e") 'my-html-forward-sentence) Oliver -- 30 Pluviôse an 211 de la Révolution Liberté, Egalité, Fraternité!