[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: keyboard macro
From: |
Stefan Monnier |
Subject: |
Re: keyboard macro |
Date: |
Mon, 21 Oct 2013 13:26:02 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> So my question: Is there a way to define a macro/keyboard function that will
> insert a certain character at the point when I write "..x" (not followed by a
> space)?
Not exactly, tho you could cook one up. E.g. (guaranteed 100% untested):
(defvar my-magic-rewrites
'(
("..a" . "ā")
))
(defvar my-last-chars nil)
(defun my-p-s-i-h ()
(unless (eq last-command this-command)
(setq my-last-chars ""))
(setq my-last-chars (concat my-last-chars (string last-command-event)))
(let ((rewrite (assoc my-last-chars my-magic-rewrites)))
(when rewrite
(delete-char (- (length (car rewrite))))
(insert (cdr rewrite)))))
(add-hook 'post-self-insert-hook #'my-p-s-i-h)
But I recommend you try instead M-x describe-input-method RET devana TAB
Stefan
- keyboard macro, Christof Spitz, 2013/10/21
- Re: keyboard macro,
Stefan Monnier <=
- Message not available
- Re: keyboard macro, Yuri Khan, 2013/10/21
- Message not available
- X keyboard settings (was keyboard macro), Rustom Mody, 2013/10/21
- Re: X keyboard settings (was keyboard macro), Yuri Khan, 2013/10/22
- Re: X keyboard settings (was keyboard macro), Joost Kremers, 2013/10/22
- Re: X keyboard settings (was keyboard macro), Stefan Monnier, 2013/10/22
- Re: X keyboard settings (was keyboard macro), Jürgen Sauermann, 2013/10/23
- Message not available
- Re: X keyboard settings (was keyboard macro), Rustom Mody, 2013/10/23
- Re: X keyboard settings (was keyboard macro), Jürgen Sauermann, 2013/10/24