[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: calc-undo keybinding
From: |
Štěpán Němec |
Subject: |
Re: calc-undo keybinding |
Date: |
Thu, 20 Jan 2011 11:06:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>>> I missed the part where you describe the problem. Is it that
>>> calc-ext.el rebinds all standard undo keys to calc-undo but doesn't
>>> rebind your C-z binding?
>
>> Yes. I can fix it in the mode hook, but is this really the way it should
>> work? It just feels like calc should hook into the existing undo
>> function.
>
> I don't know enough about calc-undo's behavior to know whether it could
> work by hooking into Emacs's undo. Clearly, it was written long before
> Emacs's undo provided hooks.
>
> But I guess a change like the patch below would be in order and should
> fix the problem for you.
>
>
> Stefan
>
>
> === modified file 'lisp/calc/calc-ext.el'
> --- lisp/calc/calc-ext.el 2011-01-16 02:21:30 +0000
> +++ lisp/calc/calc-ext.el 2011-01-19 23:12:20 +0000
> @@ -136,8 +136,7 @@
> (define-key calc-mode-map "\C-w" 'calc-kill-region)
> (define-key calc-mode-map "\M-w" 'calc-copy-region-as-kill)
> (define-key calc-mode-map "\M-\C-w" 'kill-ring-save)
> - (define-key calc-mode-map "\C-_" 'calc-undo)
> - (define-key calc-mode-map "\C-xu" 'calc-undo)
> + (substitute-key-definition 'undo 'calc-undo calc-mode-map global-map)
> (define-key calc-mode-map "\M-\C-m" 'calc-last-args)
>
> (define-key calc-mode-map "a" nil)
Why not just use command remapping, i.e.
(define-key calc-mode-map [remap undo] 'calc-undo)
? (It won't work on XEmacs AFAIK, but that's not a problem for you I'm
guessing.)
Štěpán