Skip to content
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

paredit paredit-kill #380

Closed
slipset opened this issue Oct 6, 2019 · 4 comments
Closed

paredit paredit-kill #380

slipset opened this issue Oct 6, 2019 · 4 comments
Labels
paredit Paredit and structural editing

Comments

@slipset
Copy link
Contributor

slipset commented Oct 6, 2019

In emacs, there is a function paredit-kill which (according to docs):

Kill a line as if with ‘kill-line’, but respecting delimiters.
In a string, act exactly as ‘kill-line’ but do not kill past the
closing string delimiter.
On a line with no S-expressions on it starting after the point or
within a comment, act exactly as ‘kill-line’.
Otherwise, kill all S-expressions that start after the point.

This means that if you're inside an S-expression, you kill to the end of that S-epression.
ie if | is the cursor, (foo | bar baz qix), then invoking paredit-kill would give you (foo |)

@PEZ PEZ added the enhancement label Oct 7, 2019
@PEZ
Copy link
Collaborator

PEZ commented Oct 7, 2019

Yes, I often see my Emacs wielding colleagues do that. Really cool.

For now in Calva, there is Kill Sexp Forward.

@cfehse cfehse added the paredit Paredit and structural editing label Oct 15, 2019
PEZ added a commit that referenced this issue Nov 28, 2019
Fixes #454
Somewhat fixes #380
Fixes: #379
Fixes: #260
@slipset
Copy link
Contributor Author

slipset commented Nov 29, 2019

killListForward solves this problem :)

@slipset slipset closed this as completed Nov 29, 2019
@clyfe
Copy link

clyfe commented Feb 9, 2021

In all examples that follow, killListForward outcome would be (a|).
Whereas paredit-kill has different behavior in each (it's more granular in its effects).

Example 1 - s-expresions

(a| b (c
       d) e)

+ paredit-kill = (expressions starting on the current line past the cursor are killed)

(a| e)

Example 2 - comments

(a| ;; comment
  e)

+ paredit-kill = (comment killed)

(a|
   e)

Example 3 - newline

(a|
  e)

+ paredit-kill = (newline killed)

(a| e)

@PEZ
Copy link
Collaborator

PEZ commented Feb 9, 2021

Nice examples!

Not sure why you want to dig up this old and fixed issue. Please file this as a new issue. And add this one example:

Example 4 - don't kill past end of list

(a| e)

+ paredit-kill = (rest of list killed)

(a|)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paredit Paredit and structural editing
Projects
None yet
Development

No branches or pull requests

4 participants