[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: *scratch* "corrupt
From: |
Jason Rumney |
Subject: |
Re: *scratch* "corrupt |
Date: |
Fri, 14 Oct 2005 08:45:03 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
"B. T. Raven" <ecinmn@peoplepc.com> writes:
> (global-set-key [(super 1)] (insert ?¹ ))
> (global-set-key [(super 2)] (insert ?² ))
> (global-set-key [(super 3)] (insert ?³ ))
> (global-set-key [(super 4)] (insert ?⁴ ))
> (global-set-key [(super 5)] (insert ?⁵ ))
> (global-set-key [(super 6)] (insert ?⁶ ))
> (global-set-key [(super 7)] (insert ?⁷ ))
> (global-set-key [(super 8)] (insert ?⁸ ))
> (global-set-key [(super 9)] (insert ?⁹ ))
> (global-set-key [(super 0)] (insert ?⁰ ))
> (global-set-key [(super -)] (insert ?— )) ;; mdash
1. You are running the insert commands in your .emacs. That will be
what is overwriting the *scratch* buffer.
2. You can't set a key definition to the result of a function with
arguments.
Either define functions without arguments that insert each of those
characters, and quote them in the global-set-key statement, or use a
lambda() form.
(defun insert-emdash () "Insert an emdash"
(interactive)
(insert ?—))
(global-set-key [(super -)] 'insert-emdash)
or
(global-set-key [(super -)] (lambda () (insert ?—)))