From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Zap-to-char behaviour Date: Wed, 21 May 2003 12:37:14 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305211737.h4LHbEc08523@eel.dms.auburn.edu> References: <20030521163038.2792062E4D@mallaury.noc.nerim.net> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1053540308 30185 80.91.224.249 (21 May 2003 18:05:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 21 May 2003 18:05:08 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed May 21 20:05:07 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19IXsy-0007U6-00 for ; Wed, 21 May 2003 20:00:20 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19IY3r-0001rR-00 for ; Wed, 21 May 2003 20:11:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19IXsT-0004hJ-T2 for emacs-devel@quimby.gnus.org; Wed, 21 May 2003 13:59:49 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19IXeN-0000bN-It for emacs-devel@gnu.org; Wed, 21 May 2003 13:45:15 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19IXal-0007sV-O2 for emacs-devel@gnu.org; Wed, 21 May 2003 13:42:02 -0400 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19IXWk-0006w3-16; Wed, 21 May 2003 13:37:22 -0400 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) h4LHbBoc005479; Wed, 21 May 2003 12:37:11 -0500 (CDT) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.11.6+Sun/8.11.6) id h4LHbEc08523; Wed, 21 May 2003 12:37:14 -0500 (CDT) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: jmarant@nerim.net In-reply-to: <20030521163038.2792062E4D@mallaury.noc.nerim.net> (jmarant@nerim.net) Original-cc: rms@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:14052 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:14052 J. Marant wrote: Anyway, would it be of any annoyance to add a 'zap-up-to-char' function which does the same as zap-to-char except from removing the character? (I'm currently not fluent at Elisp). No, as John Paul Wallington already pointed out, all you need to do is uncomment a comment in the function definition. If you are planning on using both functions, I would also suggest differentiating between the two echo area messages. Result: (defun zap-up-to-char (arg char) "Kill up to, but not including ARG'th occurrence of CHAR. Case is ignored if `case-fold-search' is non-nil in the current buffer. Goes backward if ARG is negative; error if CHAR not found." (interactive "p\ncZap up 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)))) The problem now is that if you want to keep the regular M-z binding to zap-to-char, then you probably will need to bind the new command to a longer key sequence and it takes only one keystroke to retype the character anyway. Sincerely, Luc.