-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sp-clone-sexp : mis-behaving in presence of quotes (') and sharp-quotes (#') #938
Comments
I could not reproduce this on emacs 25. I think E26 redefined some of the syntax properties of these characters and it breaks the code. Can you confirm this only happens when there are quotes in the sexp and not at other times so we can narrow this down as much as possible? Thanks! |
I haven't noticed problems with no quoted symbols but obviously I can't prove it. In fact experimenting I think it's when there are 2 (or maybe more quotes). I called The result remains the same up to a certain position, then the result changes and that changed result is consistent up to the next position where another change occurs. That seems correct to me as the cursor moves along the structure of the sexp. Example 1No quoted charactersThis seems correct to me. I get the same behaviour with more complex examples Before:
After:
.. same results until: Before:
After:
.. same results until: Before:
After:
.. same results until: Before:
After:
Example 2One Quoted symbols
Two Quoted symbolsIt seems to go wrong when there are 2 or more quoted symbols. I get the same incorrect result whether the sexp is one one line or split up onto 2. Before:
After:
.. same results until: Before:
After:
which now seems correct. |
Thanks for the detailed report, this will be useful! |
I have added test cases from the OP and the later post (7 in total) and they all pass now. We will have them there for future regressions. As I can't reproduce this now I will close this since I can't do anything more at this moment. |
Expected behavior
sp-clone-sexp
should recognise quoted and sharp-quoted identifiers within an sexp and clone that sexp.Actual behavior
The clone operation leaves a malformed sexp split up over 2 lines and sometimes clones the "grandparent" sexp instead of the "parent".
Steps to reproduce the problem
Entire buffer contents:
Cursor is represented by "|"
First example:
Place cursor inside the first define-key sexp e.g.
(define-key smartparens-|mode-map (kbd "C-, C-y") #'sp-clone-sexp)
M-x sp-clone-sexp
Result:
Note the #' to end the line and on the next line 'paredit
Second example:
Same starting buffer state as above:
Place cursor inside the first setq sexp e.g.
(setq |sp-base-key-bindings 'paredit)
M-x sp-clone-sexp
Result:
Backtraces if necessary (
M-x toggle-debug-on-error
)None
Environment & version information
In recent enough
smartparens
you can callM-x sp-describe-system
to generate this report. Please fill manually what we could not detect automatically. Edit the output as you see fit to protect your privacy.smartparens
version: 20181007.1501major-mode
:emacs-lisp-mode
M-x emacs-version
): GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-05The text was updated successfully, but these errors were encountered: