[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: package: iPhone behavior insert . After a word and twice space
From: |
Hi-Angel |
Subject: |
Re: package: iPhone behavior insert . After a word and twice space |
Date: |
Mon, 27 Nov 2017 00:28:53 +0300 |
On 26 November 2017 at 23:27, Thorsten Bonow
<thorsten.bonow@withouthat.org> wrote:
>>>>>> Uwe Brauer <oub@mat.ucm.es> writes:
>
>>>>> "Uwe" == Uwe Brauer <oub@mat.ucm.es> writes:
>> https://emacs.stackexchange.com/questions/3941/when-typing-automatically-transform-spc-spc-into-period-spc-spc
>
>> (defun freaky-space () (interactive) (cond ((looking-back "\\(?:^\\|\\.\\)
>> +") (insert " ")) ((eq this-command last-command) (backward-delete-char 1)
>> (insert ". ")) (t (insert " "))))
>
>> (define-key text-mode-map " " 'freaky-space)
>
>> Not bad.
>
> Nice. But this solution only works in text modes. I think it might be
> confusing after getting used to and relying on it, e.g. if you don't have this
> feature when writing a comment in some programming language. And when your
> sentence already has a dot, typing two spaces adds another one.
Yeah, I think the proper solution would be to make it working rather
in an IM, e.g. ibus or fcitx, or whatever. This way it would work not
only in Emacs, but for every application in the system. I don't have
any tips for how to do it though.
Re: package: iPhone behavior insert . After a word and twice space, Emanuel Berg, 2017/11/26