[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-mode electric braces
From: |
Carsten Burstedde |
Subject: |
Re: C-mode electric braces |
Date: |
Wed, 11 Sep 2002 17:07:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020607 |
> So, what you can do is something like follows:
,----
| (local-set-key (kbd "C-7") #'(lambda ()
| (interactive)
| ;; inserting the first electric { with
| ;; behavior as customized with cc-mode
| ;; options
| (execute-kbd-macro "{")
| (save-excursion
| ;; inserting a temporary ; so the
following
| ;; closing brace is working correctly
| (execute-kbd-macro ";")
| ;; inserting the closing electric } with
| ;; behavior as customized with cc-mode
| ;; options
| (execute-kbd-macro "}"))
| ;; now we remove the temp. inserted ;
| (delete-char 1)))
`----
Thanks, this does precisely what I wanted!
Just curious: How do I make execute-kbd-macro simulate a return press? I
made several tries, but it did not work. And what does the # in front of
the '(lambda ?
Carsten
- C-mode electric braces, Carsten Burstedde, 2002/09/10
- Re: C-mode electric braces, Kai Großjohann, 2002/09/10
- Re: C-mode electric braces, Carsten Burstedde, 2002/09/11
- Re: C-mode electric braces, Klaus Berndl, 2002/09/11
- Re: C-mode electric braces,
Carsten Burstedde <=
- Re: C-mode electric braces, Klaus Berndl, 2002/09/11
- Re: C-mode electric braces, Alan Mackenzie, 2002/09/11