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

Expose macOS native sharing dialog via ns-share #776

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xenodium
Copy link
Contributor

@xenodium xenodium commented Feb 9, 2025

The PR exposes the macOS native sharing dialog via ns-share.

Change unlikely to be accepted upstream until there's a linux equivalent, thus proposing to emacs-plus, my favorite build ;)

ns-share "does what I mean" (DWIM) by operating on either:

  • Region text (any buffer other than dired).
  • Current buffer file (any buffer other than dired an no region selected).
  • Dired marked files
  • Dired region files

A couple of sample screenshots:

share-region-text
share-dired-files

@xenodium xenodium force-pushed the native-sharing branch 6 times, most recently from cfcd691 to c461116 Compare February 9, 2025 22:12
ns-share can be invoked on:

- Region text
- Current buffer file
- Dired marked files
- Dired region files
@d12frosted
Copy link
Owner

Sounds amazing. Thanks a lot @xenodium ❤️

I see that there is some active discussions in the linked thread, so I'll wait a bit before merging. If in the end the alternative solutions would not be accepted, I'll just merge your PR. If the upstream solution will be not ideal - I am open to macos specific patch here.

Does that make sense to you? :)

@xenodium
Copy link
Contributor Author

Sounds good. Looks like there's still a chance to upstream it, so let's indeed wait for the outcome of that.

@daviderestivo
Copy link
Collaborator

@xenodium That's a nice one.

I will add it to https://github.com/daviderestivo/homebrew-emacs-head once it's stable enough :).
Thanks for having shared it ..

@xenodium
Copy link
Contributor Author

I will add it to https://github.com/daviderestivo/homebrew-emacs-head once it's stable enough :).
Thanks for having shared it ..

Still working through patch feedback, in the hope we can upstream 🤞

@daviderestivo
Copy link
Collaborator

daviderestivo commented Feb 27, 2025

I guess I have found a little bug :).

When two buffers are visible the popup menu appears always in the first left buffer even if the selection is on the right one:

native_sharing_dialog_bug0001

@xenodium
Copy link
Contributor Author

I guess I have found a little bug :)

Oooh, OK, will take a look :)

@daviderestivo
Copy link
Collaborator

@xenodium, once you have the fix, could you please open a PR for homebrew-emacs-head?

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.

3 participants