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

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

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


From: Jeff Rancier
Subject: [h-e-w] Can't override M-e in c-mode
Date: Thu, 8 Aug 2002 09:20:03 -0400

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]