From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Fredrik Staxeng Newsgroups: gmane.emacs.help Subject: Re: Zap-up-to-char in Emacs Date: 06 Dec 2002 07:34:04 +0100 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <1mznrjhd0j.fsf@Tempo.Update.UU.SE> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1039157280 3821 80.91.224.249 (6 Dec 2002 06:48:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 6 Dec 2002 06:48:00 +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 18KCHG-0000zT-00 for ; Fri, 06 Dec 2002 07:47:58 +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 18KC5m-0001xI-00; Fri, 06 Dec 2002 01:36:06 -0500 Original-Newsgroups: gnu.emacs.help Original-Lines: 31 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 Original-NNTP-Posting-Host: news.update.uu.se Original-X-Trace: puffinus.its.uu.se 1039155535 news.update.uu.se (6 Dec 2002 07:18:55 +0100) Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.bredband.com!bredband!newsfeed1.telenordia.se!algonet!newsfeed.sunet.se!news01.sunet.se!puffinus.its.uu.se Original-Xref: shelby.stanford.edu gnu.emacs.help:107785 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:4334 Benjamin Lewis writes: >On Thu, 5 Dec 2002, Jiri Pejchal wrote: > >> Hi, >> >> function zap-to-char >> >> `M-z CHAR' >> Kills through the next occurrence of CHAR (`zap-to-char'). >> >> is there a function in Emacs similar to zap-up-to-char in XEmacs that >> would kill up to and not including the next occurencce of CHAR? >From my .emacs: (defun zap-upto-char (arg char) "Kill up to and including ARG'th occurrence of CHAR. Goes backward if ARG is negative; error if CHAR not found." (interactive "*p\ncZap to char: ") (kill-region (point) (progn (search-forward (char-to-string char) nil nil arg) (goto-char (if (> arg 0) (1- (point)) (1+ (point)))) (point)))) (define-key global-map "\M-z" 'zap-upto-char) But I find I don't use it that much. There is no . command, so I use search and replace much more instead. -- Fredrik Stax\"ang | rot13: sfgk@hcqngr.hh.fr