Closed Ailrun closed 6 months ago
P.S. in smartparens-strict-mode
, <backspace>
key can't delete any region at all. Is that behavior intended? If it isn't, is there any plan to fix it?
I can't repro this. In both strict and nonstrict modes it leaves the parens intact with region selected in either way.
What version of emacs/smartparens do you use?
I use emacs 25.1 and smartparen 20170129.956 in melpa.
When I turn off smartparens-mode, deletion works well.
My emacs settings use
delete-active-region
is t
. (probably default)sp-autodelete-pair, closing-pair, openinh-pair
are t
.emacs-lisp-mode
.When with these simple configuration, I can reproduce this issue.
(emacs without init file, and evaluate (require 'package) (package-initialize) (require 'smartparens) (smartparens-global-mode)
and turn off every other minor modes except blink-cursor-mode
, font-lock-mode
, transient-mark-mode
)
mark it to,
here, and hit <backspace>
.
@Fuco1 I try this for vanilla emacs(not just without init file, but wholly pure emacs) after only installing smartparens
, and result is same.
On Windows 10, and Linux(CentOS), with emacs 25.1
, installed version of smartparen is 20170129.956
.
@Fuco1 Sorry for disturbing you. Is there any progress?
Not really. I've switched to Emacs 25 though so I'm slowly going through the issues which were only relevant to that version. I'll schedule this for the next release since you've asked, I might as well randomly prefer this issue over the others ;D
Hey @Ailrun I think this might have been fixed in 7a8dff4c6f0eb433c3f2bb92b04b5aac5d06d416 (about 4 months ago). Can you try to verify this?
@Fuco1 It still does not work. I didn't test it with pure emacs, however, I tested with
emacs -q --eval "(progn (load-file \"~/.emacs.d/elpa/dash-20180206.2124/dash.elc\") (load-file \"~/.emacs.d/elpa/smartparens-20180306.305/smartparens.elc\") (smartparens-global-mode))"
and it still delete surrounding parens.
This time,
OS is Manjaro 17.1.4,
emacs
version is 25.3.1,
smartparens
version is 20180306.305 melpa,
and dash
version is 20180206.2124 melpa.
For your convenience, formatted evaluated code is
(progn
(load-file "~/.emacs.d/elpa/dash-20180206.2124/dash.elc")
(load-file "~/.emacs.d/elpa/smartparens-20180306.305/smartparens.elc")
(smartparens-global-mode))
Are you using delete-selection-mode
?
@Fuco1 I don't know what it is, so probably I don't use it (or if it's on by default, I use it, since I don't change anything related with it.)
It's built-in mode to handle deleting of active regions but I don't know if it is on by default. Can you try to turn it on (M-x delete-selection-mode
) and then try the above scenario?
@Fuco1 I just tried it. It's off by default, and even after I turned it on, same issue happened. I also tried again after re-turning it off, and the result is same.
I reproduced the problem and pushed a fix. Thanks for the report!
Is there any good ways to delete region filled with whitespaces, without deleting wrapped parenthesis?
For example, when we have
and mark region from there to
here, and type
<backspace>
, the result isbut what I want is
However, when I mark region in reverse direction, i.e.
mark there to
here, and type
<backspace>
, it just delete whitespaces, so in this case, the result is actually what I want.I think this is the problem of advise of
backward-delete-char
that usesp-delete-pair
, sincebackward-delete-char
takes care aboutuse-region
state, wheresp-delete-pair
does not.Is there any customizable variable for this situation? Does this issue occurs because of my own ignorance?
I'm waiting your answer, thank you.