From: tyler <tyler.smith@mail.mcgill.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Setting auto-indentation of braces
Date: Wed, 18 Feb 2009 08:57:14 -0400 [thread overview]
Message-ID: <87ocwzhphx.fsf@blackbart.sedgenet> (raw)
In-Reply-To: 499936d0$0$14920$9b536df3@news.fv.fi
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.
next prev parent reply other threads:[~2009-02-18 12:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-10 10:10 Setting auto-indentation of braces Juha Nieminen
2009-02-10 16:02 ` Tiago Pierezan Camargo
2009-02-10 16:46 ` Alan Mackenzie
[not found] ` <mailman.328.1234283149.31690.help-gnu-emacs@gnu.org>
2009-02-11 15:28 ` Juha Nieminen
2009-02-16 9:50 ` Juha Nieminen
2009-02-18 8:44 ` Juha Nieminen
2009-02-18 19:00 ` Peter Dyballa
2009-02-19 4:07 ` Kevin Rodgers
[not found] ` <mailman.1146.1235016448.31690.help-gnu-emacs@gnu.org>
2009-02-23 9:47 ` Juha Nieminen
2009-02-23 11:24 ` Teemu Likonen
2009-02-24 4:56 ` Kevin Rodgers
[not found] ` <mailman.1617.1235451361.31690.help-gnu-emacs@gnu.org>
2009-02-24 17:22 ` Juha Nieminen
2009-02-25 16:14 ` Juha Nieminen
2009-03-04 23:59 ` Juha Nieminen
2009-03-05 9:20 ` Nikolaj Schumacher
[not found] ` <mailman.2415.1236244816.31690.help-gnu-emacs@gnu.org>
2009-03-09 9:45 ` Juha Nieminen
2009-03-12 5:15 ` Kevin Rodgers
[not found] ` <mailman.2991.1237105197.31690.help-gnu-emacs@gnu.org>
2009-03-23 7:56 ` Juha Nieminen
2009-03-23 16:07 ` Peter Dyballa
[not found] ` <mailman.3832.1237824475.31690.help-gnu-emacs@gnu.org>
2009-03-23 18:53 ` Juha Nieminen
2009-03-27 7:15 ` Juha Nieminen
[not found] ` <mailman.1097.1234983644.31690.help-gnu-emacs@gnu.org>
2009-02-18 23:43 ` Juha Nieminen
2009-02-19 9:40 ` Peter Dyballa
2009-02-18 12:57 ` tyler [this message]
[not found] ` <mailman.1065.1234961877.31690.help-gnu-emacs@gnu.org>
2009-02-18 18:00 ` Juha Nieminen
2009-02-19 11:31 ` Miles Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ocwzhphx.fsf@blackbart.sedgenet \
--to=tyler.smith@mail.mcgill.ca \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.