From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.help Subject: Re: remove extra whitespace on a line Date: Sat, 02 Dec 2006 18:58:03 +0100 Message-ID: <87y7pq2n9w.fsf@gmx.at> References: <87irgu8pei.fsf@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165088438 8601 80.91.229.2 (2 Dec 2006 19:40:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 2 Dec 2006 19:40:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 02 20:40:36 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 1Gqaiu-0005Ko-Tz for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Dec 2006 20:40:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gqaiu-0003dh-LA for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Dec 2006 14:40:32 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Original-Newsgroups: gnu.emacs.help Cancel-Lock: sha1:KgYrRjOyvwSPOQgWWNqtB5vRgWA= Original-Lines: 25 Original-NNTP-Posting-Host: news-access-from.tuwien.ac.at Original-X-Trace: 1165082208 tunews.univie.ac.at 11868 192.35.241.118 Original-X-Complaints-To: abuse@tuwien.ac.at Original-Xref: shelby.stanford.edu gnu.emacs.help:143606 Original-To: help-gnu-emacs@gnu.org 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:39208 Archived-At: Greg Bognar writes: > > So this is what I want, isn't it? > > (defun just-one-space-in-current-line () > (interactive) > (save-excursion > (save-restriction > (narrow-to-region (line-beginning-position) > (line-end-position)) > (goto-char (point-min)) > (canonically-space-region > (line-beginning-position) (line-end-position))))) I recommend: (defun just-one-space-in-current-line () (interactive) (save-excursion (fill-region (line-beginning-position) (line-end-position)))) All the best, Markus Triska