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

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

Re: left brackets insert both


From: rgb
Subject: Re: left brackets insert both
Date: 25 Mar 2005 12:05:27 -0800
User-agent: G2/0.2

> I'm reminded that I've long thought I should make this change:
>
> (if (and (equal (preceding-char) last-command-char)
>          (= cnt 1))
>
> I just never got around to it.
> Vary rarely does it make any difference.

And now I remember why I didn't make it earlier.  It's
really a bit more compilcated than that.   But not much.

    (defmacro my-insert-if-double (new-txt)
   "If last key same as this key, replace both with new-txt."
   `(lambda (cnt raw)
      (interactive "p\nP")
      (if (and (equal (preceding-char) last-command-char)
               (not raw))
          (progn
              (backward-delete-char 1)
              (insert ,new-txt))
          (self-insert-command cnt))))



reply via email to

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