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

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

RE: [h-e-w] Can't override M-e in c-mode


From: Eli Daniel
Subject: RE: [h-e-w] Can't override M-e in c-mode
Date: Thu, 8 Aug 2002 10:23:46 -0400

Try setting it in c-mode-map instead of globally (since it sounds like
that's really what you want anyway):

(add-hook 'c-mode-hook
        (lambda ()
          (define-key c-mode-map "\M-e" 'jbr-end-fun)))

I haven't tested this, but it's a thought...

-Eli


> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of Jeff Rancier
> Sent: Thursday, August 08, 2002 9:20 AM
> To: Emacs Help (Windows)
> Subject: [h-e-w] Can't override M-e in c-mode
>
>
> Hello All:
>
> I don't use the c-mode function: c-end-of-statement(), which is by default
> bound to M-e.  I am attempting rebind it as follows:
>
> (defun override-meta-e-key()
>   (global-set-key [(meta e)] 'jbr-end-fun)
> )
>
> I hook it:
> (add-hook 'c-mode-hook 'override-meta-e-key)
>
> In every mode but c-mode this works.  I c-mode binding the key after
> c-mode-hook is executed?  Is there a different hook that I can use?  I do
> set this in my .emacs initially.
>
> Although it's not important, jbr-end-fun() is:
>
> (defun jbr-end-fun ()
>   "Go to end of current line, bottom of this window, or bottom of the
> buffer."
>   (interactive)
>   (setq jbr-end-count
>         (if (eq last-command 'jbr-end-fun)
>             (1+ jbr-end-count)
>           0))
>   (cond ((eq jbr-end-count 0) (end-of-line))
>         ((eq jbr-end-count 1) (goto-char (-(window-end)1)))
>         (t (goto-char (point-max)))))
>
> --
>
> Thanks,
> Jeff
>
>
>
>
>
>




reply via email to

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