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: Thorsten Bonow
Subject: Re: package: iPhone behavior insert . After a word and twice space
Date: Sun, 26 Nov 2017 19:53:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

>>>>> Uwe Brauer <oub@mat.ucm.es> writes:

> Mi iphone has the nice feature that if I press space quickly twice after a
> word it inserts a . Since it is considered as a end of sentence.

> Does anybody now about a Emacs package providing this functionality?

Hi,

one solution would be "key chord" from EmacsWiki[1].  Quick and dirty:

(require 'key-chord "/usr/local/share/emacs/site-lisp/key-chord.el")
(key-chord-mode 1)
(defun my-insert-dot ()
  "Insert \".\" at point, moving point forward"
  (interactive)
  (insert "."))
(key-chord-define-global (kbd "SPC SPC") 'my-insert-dot)

There is a discussion on the page about a 'small hack to define a key-chord
starting with space'.

The Vi emulation package for GNU Emacs 'Viper' has 'timeout macros' that make
binding a key pressed twice to a macro possible.  My guess is that the Vim
emulation package "Evil"[2] must offer something similar.

I'm using 'viper' but only 'key-chord' for combinations of key-strokes.  Works
for me.

Hope this helps.

Toto


Footnotes: 
[1]  https://www.emacswiki.org/emacs/KeyChord

[2]  https://github.com/emacs-evil/evil

-- 
"A Korean newspaper wrote that Aachen University is the MIT of Europe."
Burkhard Rauhut / "Anything that's the something of something isn't
really the anything of anything." Lisa Simpson



reply via email to

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