jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.37k stars 260 forks source link

Binding `C-[` breaks all meta-keybindings #1039

Closed adimit closed 11 months ago

adimit commented 1 year ago

Here's a minimal config:

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

(use-package smartparens
  :ensure t
  :bind (("C-]" . sp-forward-slurp-sexp) ; doesn't break
     ("C-[" . sp-forward-barf-sexp))) ; breaks

I'm using Emacs 29 (haven't tried with stable Emacs yet, but I could, if it's not reproducible).

After loading above config, pressing M-x will result in user error M-x is undefined.

This seems to be a general problem in Emacs, not necessarily related to use-package. Perhaps it's impossible for use-package to handle this case :confused:

skangas commented 11 months ago

Yes, this seems to be a limitation in Emacs itself. Tested with this in emacs -Q:

(global-set-key (kbd "C-[") (lambda () (message "foo")))

Unfortunately, I don't think there is anything we can do about this in use-package itself. If this is to be changed, it has to be done in Emacs.

I'm therefore closing this bug.