From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: [PATCH] Add smart-space command. Date: Tue, 4 Dec 2012 14:55:02 -0800 Message-ID: <024ECA6D33B34D2CB69DC70F5B64B6A3@us.oracle.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354661713 406 80.91.229.3 (4 Dec 2012 22:55:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Dec 2012 22:55:13 +0000 (UTC) To: "'Michal Nazarewicz'" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 04 23:55:26 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tg1Of-0000VJ-7t for ged-emacs-devel@m.gmane.org; Tue, 04 Dec 2012 23:55:25 +0100 Original-Received: from localhost ([::1]:58490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tg1OT-0003to-Dv for ged-emacs-devel@m.gmane.org; Tue, 04 Dec 2012 17:55:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tg1OQ-0003ti-Bo for emacs-devel@gnu.org; Tue, 04 Dec 2012 17:55:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tg1OP-0007Ft-7G for emacs-devel@gnu.org; Tue, 04 Dec 2012 17:55:10 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:42748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tg1OP-0007FL-0G for emacs-devel@gnu.org; Tue, 04 Dec 2012 17:55:09 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qB4Mt7Ao012308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Dec 2012 22:55:08 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qB4Mt65w027482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Dec 2012 22:55:06 GMT Original-Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qB4Mt6bN011647; Tue, 4 Dec 2012 16:55:06 -0600 Original-Received: from dradamslap1 (/10.159.232.171) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 04 Dec 2012 14:55:06 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac3Sb9WTWm6DD/0QTIO38DhOdoBS3gAAU54A X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155269 Archived-At: > The patch below adds a smart-space command which is sort of > a generalised just-one-space. The main difference is that it behaves > differently depending on how many times it has been called, and cycles > between three states: > > 1. just one space > 2. no space at all > 3. original spacing I have nothing special to say about the command, and I haven't tried it or looked at the code. But from the description I would suggest perhaps renaming it to suggest more of what it does: `cycle-spacing' or some such. Personally, I dislike "smart" names - they often say nothing about what the function does. They tend to suggest only "this command is an improvement over the command I'm replacing it by". At best, they sometimes suggest that the command does something different depending on the context (aka context-sensitive, ~aka DWIM). In this case, the command does not seem to be deciding its behavior based on the textual context. From your desription, it is the user who controls the behavior by explicitly repeating the command. The command is flexible, not smart. Wrt adding a command that does what you describe: I think it's a good idea. The cycling might even include using a hard (nobreak) space. Or include `fixup-whitespace'. Or `delete-horizontal-space'. The cycling choices could even be customizable. Just one opinion.