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

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

Re: macro keybinding


From: Cor Gest
Subject: Re: macro keybinding
Date: Wed, 01 Oct 2008 14:57:43 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Some entity, AKA "Stefan Thomas" <kontrapunktstefan@googlemail.com>,
wrote this mindboggling stuff:
(selectively-snipped-or-not-p)

> Hi,
> since Yesterdy I try to understand emacs, so I'm a bloody newbie.
> I habve a question on macro keybindings. In the manual I've read:
> "If you give insert-kbd-macro a numeric argument, it makes additional Lisp
> code to record the keys (if any) that you have bound to macroname, so that
> the macro will be reassigned the same keys when you load the file. "
> But I don't understand that. I don't know, how to save the keybinding for
> a defined macro forever.
> And my next question would be: I would like to define some macros in a
> el-file.
> How can I load them automatically, when I start emacs?
> Thanks for Your help and Your patience,

It looks like this, to keep things simple.
make a file called parens.el

;;; --*-- emacs-lisp::parens.el --*--
;;;
;;; Change Keyboard-setting to lispy values"
;;; Interchange the [ ] keys with ( )

 (keyboard-translate ?\[ ?\()
 (keyboard-translate ?\) ?\])
 (keyboard-translate ?\] ?\))
 (keyboard-translate ?\( ?\[) 

Then you put in your .emacs : (load-file "parens.el")

Now it wil be loaded each time you start emacs, 
or do M-x load-file RET parens.el when you need it if you do not
auto-load it.

Now you will not have to do SHIFT-9 or SHIFT-0 to get ( and ).
which are now put under to the [ ] keys. 

Cor

-- 
        Mijn Tools zijn zo modern dat ze allemaal eindigen op 'saurus'
        (defvar My-Computer '((OS . "GNU/Emacs") (IPL . "GNU/Linux")))
             SPAM DELENDA EST       http://www.clsnet.nl/mail.php
                 1st Law of surviving a gunfight : Have a gun 


reply via email to

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