all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juha Nieminen <nospam@thanks.invalid>
To: help-gnu-emacs@gnu.org
Subject: Re: Setting auto-indentation of braces
Date: Mon, 16 Feb 2009 11:50:08 +0200	[thread overview]
Message-ID: <499936d0$0$14920$9b536df3@news.fv.fi> (raw)
In-Reply-To: <4991527f$0$14913$9b536df3@news.fv.fi>

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...

  Oh, man... I'm such an IDIOT! *bangs head on wall*

  You see, Macs have this really weird keyboard configuration for the
Finnish keyboard (which I'm using) which is completely different from
the PC configuration which I'm accustomed to from well over 10 years.
In the PC to get the curly braces you press AltGr+7 and AltGr+0, but
on the Mac you have to press Alt+Shift+8 and Alt+Shift+9. Needless
to say that this is really awkward to use, and I'm not accustomed to it.

  Thus I searched for a way in MacOS X to reconfigure this, and I
couldn't find any way. (Maybe there is, but I just couldn't find it. So
much for the famous "easy to use" OS...) So instead I went and tried
to remap these keys in my .emacs instead. I suppose you already
guess the reason why those braces were not being auto-indented...

  The thing is, no matter how much I tried to search info on how to
do it, I couldn't find a way to remap keys in .emacs. Or more precisely,
I couldn't find a way to make a given key combination be equivalent
to pressing some other key. So I invented this really ugly hack to get
around the problem:

(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.

  And indeed, if I type the curly brace with Alt+Shift+8 then it gets
properly auto-indented.

  I suppose my question is: What is the proper way of remapping
keys, which will not bypass any auto-indenting routines?


  parent reply	other threads:[~2009-02-16  9:50 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 [this message]
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
     [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='499936d0$0$14920$9b536df3@news.fv.fi' \
    --to=nospam@thanks.invalid \
    --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.