[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting auto-indentation of braces
From: |
tyler |
Subject: |
Re: Setting auto-indentation of braces |
Date: |
Wed, 18 Feb 2009 08:57:14 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Juha Nieminen <nospam@thanks.invalid> writes:
> Juha Nieminen kirjoitti:
>> In the macosx version this autoindentation is off, and I can't
>> figure out where to turn it on. I'm so accustomed to it, that it's
>> annoying that it doesn't work...
>
>
> (defun insert-string(s)
> (if (re-search-forward "" nil t)
> (replace-match s)))
> (defun insert-open-curly() (interactive) (insert-string "{"))
> (global-set-key "\M-7" 'insert-open-curly)
>
> Yes, as said, this is a really horrible hack, but with my limited
> knowledge of emacs it was the only thing I could come up with.
> I couldn't find any other way of "remapping" eg. "\M-7" to the curly
> brace. No wonder emacs is not auto-indenting the brace because
> I'm completely bypassing the logic behind it.
You have remapped M-7 to (insert-string "{"). If you open a file in
c-mode, and then enter C-h k { (no spaces), you'll see that the '{' key
is actually bound to c-electric-brace, not self-insert. So that's what
you should be targeting with your remapping.
Tyler
--
I'm Tyler Smith and I approve of this email.
- Re: Setting auto-indentation of braces, (continued)
- Re: Setting auto-indentation of braces, Juha Nieminen, 2009/02/18
- Re: Setting auto-indentation of braces, Peter Dyballa, 2009/02/18
- Re: Setting auto-indentation of braces, Kevin Rodgers, 2009/02/18
- Message not available
- Re: Setting auto-indentation of braces, Juha Nieminen, 2009/02/23
- Re: Setting auto-indentation of braces, Teemu Likonen, 2009/02/23
- Re: Setting auto-indentation of braces, Kevin Rodgers, 2009/02/23
- Message not available
- Re: Setting auto-indentation of braces, Juha Nieminen, 2009/02/24
- Re: Setting auto-indentation of braces, Juha Nieminen, 2009/02/26
- Message not available
- Re: Setting auto-indentation of braces, Juha Nieminen, 2009/02/19
- Re: Setting auto-indentation of braces, Peter Dyballa, 2009/02/19
Re: Setting auto-indentation of braces,
tyler <=
Message not available
Re: Setting auto-indentation of braces, Miles Bader, 2009/02/19