1

I installed a minor mode for coq-mode, called company coq. It binds the <menu> key to company-coq-toggle-definition-overlay here:

(defconst company-coq--core-map
  (let ((cc-map (make-sparse-keymap)))
    (define-key cc-map [remap proof-goto-point] #'company-coq-proof-goto-point)
    cc-map)
  "Keymap for core company-coq keybindings.
Do not edit this keymap: instead, edit `company-coq-map'.")

(defvar company-coq-map
  (let ((cc-map (make-sparse-keymap)))
    ;...
    (define-key cc-map (kbd "<menu>") #'company-coq-toggle-definition-overlay)
    cc-map)
  "Keymap of company-coq keybindings.
These keybindings are activated by `company-coq--keybindings-minor-mode'.")

(define-minor-mode company-coq--keybindings-minor-mode
  "Minor mode providing convenient company-coq keybindings."
  :lighter nil
      :keymap company-coq-map)

It says: Do not edit this keymap: instead, edit `company-coq-map'

But no matter how I try to edit company-coq-map, I still can't change it. I tried this:

(defun my-company-coq ()
      (local-set-key (kbd "<menu>") 'kill-ring-save)
      )

(eval-after-load 'company-coq-mode
      '(define-key company-coq-map [(menu)] 'kill-ring-save))

(add-hook 'cc-mode-hook 'my-company-coq)

How to reset this key to kill-ring-save?

1

Fixed by this:

(defun my-company-coq ()
      (define-key company-coq-map (kbd "<menu>") #'kill-ring-save)
      )

(add-hook 'company-coq-mode-hook 'my-company-coq)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.