From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: alex_sv Newsgroups: gmane.emacs.help Subject: Re: remove all the whitespace characters from the cursor to the next symbol Date: Tue, 16 Mar 2010 02:58:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273054939 23083 80.91.229.12 (5 May 2010 10:22:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 10:22:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 05 12:22:18 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9bk9-0006K9-EO for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 12:22:18 +0200 Original-Received: from localhost ([127.0.0.1]:59425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9bk7-00013E-Jl for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 06:22:15 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!v20g2000yqv.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: 94.25.210.15 Original-X-Trace: posting.google.com 1268733496 27273 127.0.0.1 (16 Mar 2010 09:58:16 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 16 Mar 2010 09:58:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v20g2000yqv.googlegroups.com; posting-host=94.25.210.15; posting-account=RvPXvAoAAAC66COmfkq16Km7mmTRje1Z User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091109 Ubuntu/9.10 (karmic) Firefox/3.5.5,gzip(gfe),gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177478 X-Mailman-Approved-At: Tue, 04 May 2010 16:46:57 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73351 Archived-At: On Mar 16, 5:56=A0am, Scott Frazer wrote: > On Mar 15, 10:43=A0am, alex_sv wrote: > > > > > Hi all! > > > Could you please clarify - is it possible to remove all the whitespace > > characters including newline from the current cursor position to the > > next meaningful symbol using one command? > > > I mean if our buffer's content is as follows: > > > texttexttext{cursor}___ > > _ > > ___text > > > where '_' means space character, is it possible to press some known > > key sequence to transform the given above to the following form: > > > texttexttext{cursor}text > > > Thanks in advance! > > (defun my-delete-whitespace-forward () > =A0 (interactive) > =A0 (delete-region (point) (progn (skip-chars-forward " \t\n") > (point)))) Thank you, this works fine! I didn't wrote the function because I thought this would be a reinvention of some known feature I am not aware of.