From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: gebser@ameritech.net Newsgroups: gmane.emacs.help Subject: Re: What's a better regexp for 'sentence-end' variable?? Date: Tue, 18 Feb 2003 15:15:38 -0500 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: Reply-To: gebser@ameritech.net NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1045599695 20247 80.91.224.249 (18 Feb 2003 20:21:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 18 Feb 2003 20:21:35 +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 18lEFB-0005GK-00 for ; Tue, 18 Feb 2003 21:21:33 +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 18lEDx-0003LK-04 for gnu-help-gnu-emacs@m.gmane.org; Tue, 18 Feb 2003 15:20:17 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uio.no!quimby.gnus.org!heidegger.mousecar.net!ken Original-Newsgroups: gnu.emacs.help Original-Lines: 61 Original-NNTP-Posting-Host: adsl-65-43-210-108.dsl.bcvloh.ameritech.net Original-X-Trace: quimby.gnus.org 1045600121 7104 65.43.210.108 (18 Feb 2003 20:28:41 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 18 Feb 2003 20:28:41 GMT In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:110350 X-Originally-To: Oliver Scholz 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:6852 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6852 Oliver, Thanks very much. That works fairly well. I amended the regexp just a little bit to include "sentence-end"s which are normal, just a period etc. and a space. The question now is how to have this load when emacs loads. I put it in .emacs, reloaded, and got an error: Error in init file: Symbol's value as variable is void: sgml-mode-map This is because it's not in the path. So how do I get it in the path? Thanks again for your assist, ken Oliver Scholz at 15:06 (UTC+0100) on Tue, 18 Feb 2003 said: = 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 =