bbatsov / prelude

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.
https://prelude.emacsredux.com
5.12k stars 1.86k forks source link

Prefix for "search-map" in prelude-vertico.el shadowed by smartparens #1400

Open bgschaid opened 1 year ago

bgschaid commented 1 year ago

Expected behavior

M-s should be the prefix for some commands (the mapping is defined in prelude-vertico.el

Actual behavior

In programming modes the key does nothing or moves text around.

Steps to reproduce the problem

In a buffer with a programming mode enter C-h k M-s and the buffer should show

M-s (translated from <escape> s) runs the command sp-splice-sexp
(found in smartparens-mode-map), which is an interactive native
compiled Lisp function in ‘smartparens.el’.

It is bound to M-s.

Environment & Version information

Emacs version

GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-05-31 Mark set

Operating system

Linux Ubuntu 22.04

byronclark commented 1 year ago

Just ran into this today and I'm not sure how to best resolve it.

In prelude-editor.el, smartparens is being set up using the paredit based keybindings:

(require 'smartparens-config)
(setq sp-base-key-bindings 'paredit)
(setq sp-autoskip-closing-pair 'always)
(setq sp-hybrid-kill-entire-symbol nil)
(sp-use-paredit-bindings)

Those bindings include M-s for sp-slice-sexp (which I use pretty frequently). If it weren't frequently used, I'd vote for unmapping that key.

We could use the sp set of keybindings instead for smartparens, but that's would be fairly surprising to users who are used to the paredit bindings.

The two good options I see are:

  1. Change the bindings prefixed with M-s in consult
    • Downside is that these appear to be commonly used bindings for consult
  2. Make the smartparens keybinding set configurable in prelude
    • Downside is that using the paredit style bindings and M-s for consult still isn't possible