Skip to content

Commit

Permalink
fix(tuareg.el): Fix and improve Emacs bindings
Browse files Browse the repository at this point in the history
(following the discussion in ocaml#273)
  • Loading branch information
erikmd committed Aug 31, 2023
1 parent ac5428e commit 7ba0c3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ unreleased
----------

* Add support for [opam-switch-mode](https://github.com/ProofGeneral/opam-switch-mode): enable the mode with <kbd>M-x opam-switch-mode</kbd> or add an automatic hook `(add-hook 'tuareg-mode-hook #'opam-switch-mode)`.
* Fix keybindings to comply with [GNU Emacs' Key Binding Conventions](https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html) (unbind <kbd>C-c ?</kbd> as <kbd>C-c `</kbd> is already set; unbind <kbd>C-c C-h</kbd> and bind <kbd>C-h .</kbd> instead). See also [this issue](https://github.com/ocaml/merlin/issues/1386#issuecomment-1701567716).

3.0.1 2022-09-29
----------------
Expand Down
4 changes: 1 addition & 3 deletions tuareg.el
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,6 @@ Run only once."
(define-key map "\C-c\C-i" #'tuareg-interrupt-ocaml)
(define-key map "\C-c\C-k" #'tuareg-kill-ocaml)
(define-key map "\C-c`" #'tuareg-interactive-next-error-source)
(define-key map "\C-c?" #'tuareg-interactive-next-error-source)
(define-key map "\C-c.c" #'tuareg-insert-class-form)
(define-key map "\C-c.b" #'tuareg-insert-begin-form)
(define-key map "\C-c.f" #'tuareg-insert-for-form)
Expand All @@ -1527,7 +1526,7 @@ Run only once."
(define-key map [?\C-c ?\C-i] #'ocaml-add-path)
(define-key map [?\C-c ?\[] #'ocaml-open-module)
(define-key map [?\C-c ?\]] #'ocaml-close-module)
(define-key map [?\C-c ?\C-h] #'caml-help)
(define-key map [?\C-h ?.] #'caml-help)
(define-key map [?\C-c ?\t] #'tuareg-complete))
map)
"Keymap used in Tuareg mode.")
Expand Down Expand Up @@ -3528,7 +3527,6 @@ OCaml uses exclusive end-columns but Emacs wants them to be inclusive."
(define-key map "\C-c\C-k" #'tuareg-kill-ocaml)
(define-key map "\C-c\C-z" #'tuareg-switch-to-recent-buffer)
(define-key map "\C-c`" #'tuareg-interactive-next-error-repl)
(define-key map "\C-c?" #'tuareg-interactive-next-error-repl)
(define-key map "\C-m" #'tuareg-interactive-send-input)
(define-key map [(shift return)]
#'tuareg-interactive-send-input-end-of-phrase)
Expand Down

0 comments on commit 7ba0c3f

Please sign in to comment.