From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.help Subject: Re: Deleting chunks of whitespace Date: Sat, 16 Nov 2002 17:58:27 +0200 Organization: Mivtach-Simon Insurance agencies Sender: help-gnu-emacs-admin@gnu.org Message-ID: <200211161558.gAGFwR6J003804@beta.mvs.co.il> References: Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8 Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1037463208 11335 80.91.224.249 (16 Nov 2002 16:13:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 16 Nov 2002 16:13:28 +0000 (UTC) Cc: help-gnu-emacs@gnu.org 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 18D5ZW-0002wa-00 for ; Sat, 16 Nov 2002 17:13:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18D5ZB-0006JP-00; Sat, 16 Nov 2002 11:13:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18D5LQ-0005Io-00 for help-gnu-emacs@gnu.org; Sat, 16 Nov 2002 10:58:52 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18D5LK-0005F6-00 for help-gnu-emacs@gnu.org; Sat, 16 Nov 2002 10:58:49 -0500 Original-Received: from unix.sw.co.il ([192.114.178.12] helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.10) id 18D5LI-00058p-00 for help-gnu-emacs@gnu.org; Sat, 16 Nov 2002 10:58:45 -0500 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.11.6/8.11.6) with ESMTP id gAGFwUh27493; Sat, 16 Nov 2002 17:58:31 +0200 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.12.5/8.12.5) with ESMTP id gAGFwTed003810; Sat, 16 Nov 2002 17:58:30 +0200 Original-Received: (from ehud@localhost) by beta.mvs.co.il (8.12.5/8.12.5/Submit) id gAGFwR6J003804; Sat, 16 Nov 2002 17:58:27 +0200 X-Authentication-Warning: beta.mvs.co.il: ehud set sender to ehud@unix.mvs.co.il using -f Original-To: rvmolen@bambecksystems.com In-reply-to: (rvmolen@bambecksystems.com) X-Mailer: Emacs 21.2.91.3 rmail (send-msg 1.106) 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:3660 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3660 On 15 Nov 2002 13:08:48 -0800, rvmolen@bambecksystems.com (Richard V. Molen) wrote: > > This is behavior is similar to alternating between M-SPC & M-d > and then doing a C-k if at there's no more on the current line. > Two exceptions being the: 1. the cursor doesn't move (not a big > deal) 2. M-d would not cut all non-whitespace characters, but > only alphanumeric strings. I think this command will do what you want: (defun kill-to-non-blank () "kill to 1st non blank (after blank) to right" (interactive "*") (kill-region (point) (progn (forward-to-non-blank) (point)))) (defun forward-to-non-blank () "go to 1st non blank (after blank) to right" (interactive) (if (re-search-forward "[ \t\n][^ \t\n]" (point-max) t) (backward-char 1))) I assign it to [C-delete] i.e. (define-key global-map '[C-delete] 'kill-to-non-blank) One hint: on some X-terminals the keypad delete is [C-kp-decimal]. Ehud. -- Ehud Karni Tel: +972-3-7966-561 /"\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ mailto:ehud@unix.mvs.co.il Better Safe Than Sorry