[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: left brackets insert both
From: |
Shug Boabby |
Subject: |
Re: left brackets insert both |
Date: |
25 Mar 2005 10:23:32 -0800 |
User-agent: |
G2/0.2 |
excellent rgb! i have kept your original function as it is nice anyway,
but modified it to this:
(defmacro my-bothbraces-if-double (new-txt)
"If the last key is the same as this key, insert new-txt and go back
a char"
`(lambda (cnt)
(interactive "p")
(if (equal (preceding-char) last-command-char)
(progn
(insert ,new-txt)
(backward-char))
(self-insert-command cnt))))
(global-set-key "\"" (my-bothbraces-if-double "\""))
(global-set-key "\'" (my-bothbraces-if-double "\'"))
(global-set-key "\{" (my-bothbraces-if-double "\}"))
(global-set-key "\[" (my-bothbraces-if-double "\]"))
(global-set-key "\(" (my-bothbraces-if-double "\)"))
(global-set-key "\<" (my-bothbraces-if-double "\>"))
i hope it helps others!
- left brackets insert both, Shug Boabby, 2005/03/25
- Re: left brackets insert both, rgb, 2005/03/25
- Re: left brackets insert both, David Hansen, 2005/03/25
- Re: left brackets insert both, Shug Boabby, 2005/03/25
- Re: left brackets insert both, rgb, 2005/03/25
- Re: left brackets insert both,
Shug Boabby <=
- Re: left brackets insert both, rgb, 2005/03/25
- Re: left brackets insert both, rgb, 2005/03/25
- Re: left brackets insert both, Shug Boabby, 2005/03/25
- Re: left brackets insert both, rgb, 2005/03/25
- Re: left brackets insert both, David Hansen, 2005/03/26
Re: left brackets insert both, Peter Lee, 2005/03/25