help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: package: iPhone behavior insert . After a word and twice space


From: Uwe Brauer
Subject: Re: package: iPhone behavior insert . After a word and twice space
Date: Sun, 26 Nov 2017 21:53:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

"Thorsten" == Thorsten Bonow <thorsten.bonow@withouthat.org> writes:

>>>>>> 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.
Well I just bound it globally and it worked, I wrote a trivial function
which toogle on and of this key setting and it works even in lisp mode.


  > But I guess the last problem can be solved by modifying the regexp.
  > 'paragraphs.el' (included in GNU Emacs) has `sentence-end', which returns 
the
  > regexp describing the end of a sentence.  Maybe start from there.

Right first I check your other solution
  > Toto




reply via email to

[Prev in Thread] Current Thread [Next in Thread]