Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emacs key bindings docs and changing them #28

Closed
dbuenzli opened this issue Dec 20, 2013 · 1 comment
Closed

emacs key bindings docs and changing them #28

dbuenzli opened this issue Dec 20, 2013 · 1 comment

Comments

@dbuenzli
Copy link

It seems not all key bindings are documented here:

> grep key ocp-index.el 
(defun ocp-index-setup-keymap ()
  (local-set-key (kbd "C-c t") 'ocp-index-print-type-at-point)
  (local-set-key (kbd "C-c ;") 'ocp-index-jump-to-definition-at-point-other-window)
  (local-set-key (kbd "C-c :") 'ocp-index-jump-to-sig-at-point-other-window)
  (local-set-key (kbd "C-c C-;") 'ocp-index-jump-to-definition-at-point)
  (local-set-key (kbd "C-c C-:") 'ocp-index-jump-to-sig-at-point)
  (local-set-key (kbd "C-c TAB") 'auto-complete))
  (ocp-index-setup-keymap)

Besides those key bindings are not so practical on certain keyboard layouts (like swiss french, both ; and : need shift). Is there a way of configuring them without resorting to global-set-key ?

AltGr added a commit that referenced this issue Dec 23, 2013
it seems to be the better way to do it. Not sure if this really helps for #28 though
@dbuenzli
Copy link
Author

dbuenzli commented Jan 9, 2014

I think the patch helps since now we have the function names when we do a M-x describe-bindings, which means we don't have to go to hunt in the source code to know that. To override we can just add a hook to our major mode:

(add-hook 
 'caml-mode-hook
 (lambda () 
   (local-set-key (kbd "C-c .") 
                  'ocp-index-jump-to-definition-at-point-other-window)
   (local-set-key (kbd "C-c ,")
                  'ocp-index-jump-to-sig-at-point-other-window)
   (local-set-key (kbd "C-c C-.") 
                  'ocp-index-jump-to-definition-at-point-other-window)
   (local-set-key (kbd "C-c C-,")
                  'ocp-index-jump-to-sig-at-point-other-window)))

I'm not sure there's a better way to do that. However note that you should not use C-c t, keybindings C-c + letter are reserved for the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants