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

Add an option to control the save of clipboard content before killing. #1738

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

funk443
Copy link
Contributor

@funk443 funk443 commented Jan 7, 2025

Users can now set *save-interprogram-clipboard-before-kill-p* in package lem-core/commands/edit to choose whether or not to save the interprogram (system) clipboard content into killring before killing other things in Lem.

I'm a bit concerned about performance of (string= clipboard-string (peek-killring-item (current-killring) 0) if the clipboard data is very huge.

@@ -60,6 +60,8 @@
(define-key *global-keymap* "C-_" 'redo)
(define-key *global-keymap* "C-/" 'redo)

(defparameter *save-interprogram-clipboard-before-kill-p* nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this variable is unnecessary as it will only complicate things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this behaviour probably shouldn't be enabled by default, since somebody may have copied their password before killing in Lem, if this is enabled by default, their password would be in the killring, which is probably not great.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think of adding a function to view/edit/clear the killring.
Would that solve the problem?

Also should we consider the possibility that the password copied to killring could be stolen by malware targeting Lem, even if it means sacrificing convenience?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should we consider the possibility that the password copied to killring could be stolen by malware targeting Lem, even if it means sacrificing convenience?

That's a fair point, since the user has a higher chance to press C-y accidentally and paste his password into the buffer. I'll remove this then.

Previously, if someone have enabled relative line numbers, and have
the attribute of active line number (the line number of the line where
the point is) different than that of normal line number, they will see
something like this:

```
 1 ...
*2*... | <- this is where the point is, *2* means 2 is highlighted.
 1 ...
*2*... line number still highlighted, while the point is NOT here!
 3 ...
```
@funk443
Copy link
Contributor Author

funk443 commented Jan 7, 2025

Dang it, I didn't mean to push 68678b6 here. Well, since it's here, maybe you can review it all together? The issue I tried to address in 68678b6:

Previously, if someone have enabled relative line numbers, and have the attribute of active line number (the line number of the line where the point is) different than that of normal line number, they will see something like this:

 1 ...
*2*... | <- this is where the point is, *2* means 2 is highlighted.
 1 ...
*2*... line number still highlighted, while the point is NOT here!
 3 ...

@cxxxr
Copy link
Member

cxxxr commented Jan 8, 2025

I think it's a good improvement.
Thank you so much.

@cxxxr cxxxr merged commit 8d4c9be into lem-project:main Jan 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants