smartparens
smartparens copied to clipboard
can't insert single quote (`'`) in expression minibuffer in strict mode
Expected behavior
In strict mode M-: '
should result in single quote being typed in the expression minibuffer.
Actual behavior
Quote is doubled instead. And since this is strict mode, I can't delete the extra quote. Temporary workaround: use (quote)
.
Steps to reproduce the problem
Config that reproduces the problem:
(require 'smartparens-config)
(add-hook 'eval-expression-minibuffer-setup-hook #'smartparens-strict-mode)
Then type M-:
(eval-expression) and then type single quote character ('
).
Environment & version information
-
smartparens
version: 20200324.2147 - Active
major-mode
:lisp-interaction-mode
- Smartparens strict mode: t
- Emacs version (
M-x emacs-version
): GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.17.3) of 2020-05-27 - Starterkit/Distribution: Vanilla
- OS: gnu/linux
(defun aorst/minibuffer-enable-sp ()
"Enable `smartparens-strict-mode' in the minibuffer, during `eval-expression'."
(when (eq this-command 'eval-expression)
(setq-local comment-start ";")
(sp-local-pair 'minibuffer-pairs "'" nil :actions nil)
(sp-local-pair 'minibuffer-pairs "`" nil :actions nil)
(sp-update-local-pairs 'minibuffer-pairs)
(smartparens-strict-mode 1)))
I hook this funtion to minibuffer-setup
hook and it seems to work
@andreyorst Thank you, that works!
I found that it is possible to get rid of "(when (eq this-command ..." by hooking eval-expression-minibuffer-setup-hook instead of minibuffer-setup-hook.
oh, great! Did not knew of that hook, thanks for the tip!
Perhaps this should be documented, and tiket can be resolved?
Up to the project owner, I guess. I saw that he marked the issue as a bug, so maybe he plans to do something else (one could argue that smartparens-strict-mode should allow quotes in minbuffer as well as in usual .el buffers - because in both cases we have elisp as a dialect).