From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.help Subject: RE: remove extra whitespace on a line Date: Sat, 02 Dec 2006 15:01:15 +0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1165042901 19054 80.91.229.2 (2 Dec 2006 07:01:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 2 Dec 2006 07:01:41 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 02 08:01:38 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GqOsU-0005rk-Cd for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Dec 2006 08:01:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GqOsU-00061B-3V for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Dec 2006 02:01:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GqOsG-000611-RB for help-gnu-emacs@gnu.org; Sat, 02 Dec 2006 02:01:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GqOsC-0005yi-9N for help-gnu-emacs@gnu.org; Sat, 02 Dec 2006 02:01:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GqOsC-0005yf-4E for help-gnu-emacs@gnu.org; Sat, 02 Dec 2006 02:01:20 -0500 Original-Received: from [65.54.246.239] (helo=bay0-omc3-s39.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GqOsB-0002Qt-El for help-gnu-emacs@gnu.org; Sat, 02 Dec 2006 02:01:19 -0500 Original-Received: from hotmail.com ([64.4.26.44]) by bay0-omc3-s39.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 1 Dec 2006 23:01:18 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 1 Dec 2006 23:01:18 -0800 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Sat, 02 Dec 2006 07:01:15 GMT X-Originating-IP: [216.145.54.158] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: Original-To: bognar@christal.elte.hu, help-gnu-emacs@gnu.org X-OriginalArrivalTime: 02 Dec 2006 07:01:18.0225 (UTC) FILETIME=[AA4A8810:01C715DF] 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:39193 Archived-At: How about this? (defun just-one-space-in-current-line (&optional n) (interactive "*p") (save-excursion (save-restriction (narrow-to-region (line-beginning-position) (line-end-position)) (goto-char (point-min)) (while (re-search-forward "[ \t]" nil t) (just-one-space n))))) Regards, Guanpeng Xu >From: Greg Bognar >To: help-gnu-emacs@gnu.org >Subject: remove extra whitespace on a line >Date: Sat, 02 Dec 2006 01:27:00 -0500 > >Suppose I have a line like this. > >How can I remove the extra spaces from the line? So that I end up with >this: > >Suppose I have a line like this. > >Exactly like fill-paragraph, but I do not want to "fill" the paragraph, >only the current line. Is there an Emacs function to do this? > >Thanks, >Greg >_______________________________________________ >help-gnu-emacs mailing list >help-gnu-emacs@gnu.org >http://lists.gnu.org/mailman/listinfo/help-gnu-emacs _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/