unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michal Nazarewicz <mpn@google.com>
To: Drew Adams <drew.adams@oracle.com>, emacs-devel@gnu.org
Subject: RE: [PATCH] Add smart-space command.
Date: Wed, 05 Dec 2012 00:11:51 +0100	[thread overview]
Message-ID: <xa1td2yp2z0o.fsf@mina86.com> (raw)
In-Reply-To: <024ECA6D33B34D2CB69DC70F5B64B6A3@us.oracle.com>

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

>> 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

On Tue, Dec 04 2012, Drew Adams wrote:
> 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.

Sure, that sounds fine by me.  Truth to be said, I could not came up
with a good name so I escaped into the “smart” realm. ;)

> 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.

The second state is `delete-horizontal-space' (with backward-only being
nil) essentially, but yes, I thought about making something even more
configurable, like accepting a list of states or something, but I didn't
want to make the function too complex, and rather get it to do what
I think would be the most useful thing.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2012-12-04 23:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 22:36 [PATCH] Add smart-space command Michal Nazarewicz
2012-12-04 22:55 ` Drew Adams
2012-12-04 23:11   ` Michal Nazarewicz [this message]
2012-12-10 14:57 ` [PATCHv2] Add cycle-spacing command Michal Nazarewicz
2013-01-17 11:41   ` [PATCHv3] " Michal Nazarewicz
2013-01-17 13:06     ` Lele Gaifax
2013-01-26 15:26       ` [PATCHv4] " Michal Nazarewicz
2013-01-26 17:14         ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xa1td2yp2z0o.fsf@mina86.com \
    --to=mpn@google.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).