7

I'm trying to change the key bindings to all the smerge commands. I added :

(setq smerge-command-prefix "\C-c v")

to my Emacs config. M-x customize smerge confirms that the Smerge Command Prefix is ^C v but all my smerge commands still starts with C-c ^.

I also tried

(setq smerge-command-prefix (kbd "C-c v"))

but same result.

1
  • Came here looking for how to customize smerge keybindings. M-x customize smerge pointed me to the answer: M-x customize-variable RET smerge-command-prefix.
    – mcp
    Apr 10, 2021 at 16:02

2 Answers 2

4

It looks like this will take effect if you restart Emacs.

Alternatively, M-x load-library RET smerge RET will process it. (In which case the old prefix will also remain active, until you restart.)

3
  • I've tried restarting my emacs daemon multiple times but still no effects. I just tried load-library also but still nothing. Thanks though.
    – M-Gregoire
    Sep 24, 2018 at 10:59
  • 3
    It worked for me after (setq smerge-command-prefix (kbd "C-c v")) in Emacs 26.1.
    – phils
    Sep 24, 2018 at 11:09
  • Thanks you for your help. I tried it with emacs -Q and it works perfectly. After spending some time investigating the problem in my emacs config, I found the source of the problem to be magit-filenotify.el (github.com/ruediger/magit-filenotify). I'm not sure yet why it breaks this keybinding.
    – M-Gregoire
    Sep 24, 2018 at 13:03
2

smerge-command-prefix is used by smerge.el when the smerge.el file is loaded. So you need to perform your setq before smerge.el is loaded. My crystal ball tells me that you likely have something in your .emacs which causes smerge to be loaded before that setq.

2
  • Thank you very much for your help, unfortunately, I don't think this is the problem as disabling magit-filenotify.el solves the issue (As explain to @phils) but smerge.el isn't called by this file. I still have to take the time to understand why.
    – M-Gregoire
    Sep 24, 2018 at 13:07
  • magit-filenotify.el requires magit which requires magit-diff which requires smerge-mode
    – phils
    Sep 24, 2018 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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