From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: sandipchitale@yahoo.com (Sandip Chitale) Newsgroups: gmane.emacs.help Subject: Re: Deleting all succeeding whitespace Date: 25 Aug 2003 15:50:36 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1061853656 2491 80.91.224.253 (25 Aug 2003 23:20:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Aug 2003 23:20:56 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 26 01:20:54 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19rQdq-0002ub-00 for ; Tue, 26 Aug 2003 01:20:54 +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 19rQQb-0007Ff-02 for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Aug 2003 19:07:13 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: 208.135.53.4 Original-X-Trace: posting.google.com 1061851837 22688 127.0.0.1 (25 Aug 2003 22:50:37 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 25 Aug 2003 22:50:37 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:116139 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12057 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12057 "Eric Bessette" wrote in message news:... > I'd like to have a key binding that deletes all of the whitespace after the > current cursor position. Is there a function in emacs that does this? Can > I create one, if so, I'd appreciate some help? > > Thanks, > Eric I have this: (defun delete-forward-backward-horizontal-space (arg) "Delete all spaces and tabs forward from point. With argument delete all spaces and tabs backword." (interactive "*P") (let ((orig-pos (point))) (delete-region orig-pos (progn (if arg (skip-chars-backward " \t") (skip-chars-forward " \t")) (constrain-to-field nil orig-pos t))))) (global-set-key [(meta ?\ )] 'delete-forward-backward-horizontal-space)