From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Eure Newsgroups: gmane.emacs.help Subject: Re: Running just-one-space after expand-abbrev Date: Thu, 13 Nov 2008 11:52:28 -0800 Message-ID: <0A57C1D8-D3D5-4EE1-9B12-313997ADCBDC@digg.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226606301 20761 80.91.229.12 (13 Nov 2008 19:58:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2008 19:58:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Nikolaj Schumacher Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 13 20:59:24 2008 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.50) id 1L0iLQ-00078w-Cj for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Nov 2008 20:59:12 +0100 Original-Received: from localhost ([127.0.0.1]:48725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0iKI-0000jn-D9 for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Nov 2008 14:58:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0iEx-0007At-R6 for help-gnu-emacs@gnu.org; Thu, 13 Nov 2008 14:52:31 -0500 Original-Received: from [199.232.76.173] (port=60541 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0iEx-0007Ag-Ej for help-gnu-emacs@gnu.org; Thu, 13 Nov 2008 14:52:31 -0500 Original-Received: from mail.digg.com ([64.191.203.36]:51861) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0iEx-0000Bn-78 for help-gnu-emacs@gnu.org; Thu, 13 Nov 2008 14:52:31 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id 717BDA851DD; Thu, 13 Nov 2008 11:52:29 -0800 (PST) X-Virus-Scanned: amavisd-new at X-Spam-Score: -4.534 Original-Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p+hfNXcDEPuY; Thu, 13 Nov 2008 11:52:28 -0800 (PST) Original-Received: from [10.2.16.90] (diggstage01.digg.com [64.191.203.34]) by mail.digg.com (Postfix) with ESMTP id 7AD3DA8516D; Thu, 13 Nov 2008 11:52:28 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.929.2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:59759 Archived-At: On Nov 13, 2008, at 11:33 AM, Nikolaj Schumacher wrote: > Ian Eure wrote: > >> The problem is that the M-d leaves the whitespace to the left of >> "function," and the SPC to expand the abbrev gives another, so now I >> have two spaces. > > This has annoyed me as well in the past. I took a different route in > the solution. just-one-space would collide with my finger memory when > inserting something in the middle. Instead I chose to give the tab > key > an additional function > > (defun tab-command () > "Do the right thing for the tab key." > (interactive) > (or (expand-abbrev) > (indent-according-to-mode))) > > My tab-command does in fact do many more things depending on context. > This is the abridged version. :) > Alas, this doesn't solve the case I illustrated, since I want to eliminate extra whitespace from the middle of the line, rather than fix whitespace at the beginning. I think I may need to disable the global abbrev mode and rebind SPC to (self-insert-command) (and (expand-abbrev) (just-one-space)). Thanks for the suggestion, though. - Ian