Closed AkashaP closed 11 months ago
I have found a solution that seems to work for me but i have no idea if it is a good idea or not
(defun sp-delete-word-issue-1097 ()
"hotfix for https://github.com/Fuco1/smartparens/issues/1097#issue-970201884"
(interactive)
(make-local-variable 'kill-ring-yank-pointer) ;; is this really safe?
(let* (;;(kill-ring kill-ring)
(kill-ring-yank-pointer kill-ring-yank-pointer)
(select-enable-clipboard nil))
(sp-delete-word 1)))
Yea, I also get this from time to time but I never connected it to smartparens. It might be that some internals changed in the meantime and our code is no longer compatible with newer Emacs versions. I'll test your fix.
Fixed in #1169
Ive noticed a lot of delete commands seem to bug out the emacs yanking system, but im not sure exactly why. I dont know if this is because of smartparens but using smartparens based commands does cause the bug to happen.
Expected behavior
delete commands to leave next yank alone, as per the steps:
Actual behavior
The equivalent smartparens commands seem to bug out yank system completely and yank something i think i appended to the kill ring like days or weeks ago
Steps to reproduce the problem
(The bug seems to happen with all delete-like commands and not just sp-delete-word)
I usually end up with text i dont even know where it is coming from. I'm relatively new to emacs, I looked at the smartparens source and saw that it does something along the lines of shadowing the kill-ring in a let so that the real kill-ring doesnt actually get changed.
In addition i can't yank-pop after step 6 i get the error 'previous command was not a yank'
But when i evaluate (car kill-ring-yank-pointer) i can see that the deleted text is still there ~~, but not in (car kill-ring). I dont really understand why kill-ring-yank-pointer contains different things from kill-ring or why it bugs out yank. I might experiment around with my own yank command that just pops kill-ring-yank-pointer or something. EDIT just looked at the documentation for emacs and i think most of this is actually working as intended but~~ doing the steps for the vanilla emacs commands doesnt append the deleted text to kill-ring-yank-pointer
By the way, looking at emacs source i can see that emacs itself is coded to put its delete commands in terms of kill commands but i find that logic so backwards, shouldnt it be the other way around?
Backtraces if necessary (
M-x toggle-debug-on-error
)Environment & version information
im using spacemacs-base for my emacs configuration
smartparens
version: 20210529.1129major-mode
:emacs-lisp-mode
M-x emacs-version
): GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian