From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dieter Wilhelm Newsgroups: gmane.emacs.help Subject: Re: remove extra whitespace on a line Date: Sat, 02 Dec 2006 21:52:36 +0100 Organization: The Church of Emacs Message-ID: <87lklq3trf.fsf@hans.local.net> References: <87irgu8pei.fsf@gmx.at> <87hcwersbc.fsf@localhorst.mine.nu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165104111 20130 80.91.229.2 (3 Dec 2006 00:01:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 3 Dec 2006 00:01:51 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 03 01:01:49 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 1Gqem2-00015G-E7 for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Dec 2006 01:00:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gqem2-0003Z6-5W for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Dec 2006 19:00:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gqelp-0003XB-2I for help-gnu-emacs@gnu.org; Sat, 02 Dec 2006 18:59:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gqeln-0003Wg-Ap for help-gnu-emacs@gnu.org; Sat, 02 Dec 2006 18:59:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gqeln-0003Wd-6I for help-gnu-emacs@gnu.org; Sat, 02 Dec 2006 18:59:47 -0500 Original-Received: from [212.227.126.171] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gqelm-0003Xb-Lr for help-gnu-emacs@gnu.org; Sat, 02 Dec 2006 18:59:47 -0500 Original-Received: from [84.167.53.90] (helo=duenenhof-wilhelm.de) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1Gqell05w0-0005S1; Sun, 03 Dec 2006 00:59:45 +0100 Original-Received: by duenenhof-wilhelm.de (Postfix, from userid 1000) id AAEB9768D0; Sat, 2 Dec 2006 21:52:37 +0100 (CET) Original-To: help-gnu-emacs@gnu.org In-Reply-To: <87hcwersbc.fsf@localhorst.mine.nu> (David Hansen's message of "Sat\, 02 Dec 2006 20\:49\:59 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:d7ab225b98a136e1c2910381f940ecb9 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:39218 Archived-At: David Hansen writes: > On Sat, 02 Dec 2006 12:40:43 -0500 Greg Bognar wrote: > >> So this is what I want, isn't it? >> >> (defun just-one-space-in-current-line () >> (interactive) >> (save-excursion >> (save-restriction ... > > C-a C-SPC C-e M-x canonically-space-region > >> (line-beginning-position) (line-end-position))))) > > > Or your code a bit compressed: > > (defun just-one-space-in-current-line () > (interactive) > (canonically-space-region (point-at-bol) (point-at-eol))) Thanks for the aliases! (= (point-at-bol) (line-beginning-position)) -- Best wishes H. Dieter Wilhelm Darmstadt, Germany