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

feat(ext): Add Emacsclient as an editor option #158

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

mavit
Copy link
Contributor

@mavit mavit commented Jan 29, 2025

Description

Emacsclient asks an existing Emacs process to open the file. For many users, this is likely to be more appropriate than the existing Emacs option, which always starts a new Emacs process to edit the email.

Changes

66fdbed feat(ext): Add emacsclient as an editor option

emacsclient asks an existing Emacs process to open the file. For many users, this is likely to be more appropriate than the existing Emacs option, which always starts a new emacs process to edit the email.

Checklist

  • I have rebased my branch so that it has no conflicts
  • I have added tests where appropriate
  • Commit messages are compliant with Conventional Commits

Is this a breaking change?

No.

Test results

  • OS: Linux (Fedora 40)
  • Thunderbird version: 128.6.0

Success.

Copy link
Owner

@Frederick888 Frederick888 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Edit: Urgh don't worry about the CI failures, I'll fix them later.

Edit 2: CI fixed :)

@@ -7,6 +7,7 @@ class Editor {
const editors = {
'nvim': new Editor('nvim', false),
'vim': new Editor('vim', false),
'emacsclient': new Editor('emacsclient --alternate-editor= --reuse-frame', true),
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not an Emacs user and I don't know what an Emacs frame is, so I'll just have to trust you on this one. But please let me know if any of these arguments is 'opinionated' and may not work for the wider crowd.

And I'd appreciate a post to Discussions later if it's needed, explaining how this interacts with e.g. https://www.emacswiki.org/emacs/EmacsClient#h5o-5.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An Emacs "frame" is what the rest of the world calls a window. An Emacs "window" is what the rest of the world calls a frame. I guess the Emacs usage of window pre-dates the widespread availability of GUIs.

  • --alternate-editor= means, if no existing Emacs server is running, start one in the background using the default options, then connect to that.
  • --reuse-frame means, open the file in an existing Emacs window if one exists, else open a new one.
  • --create-frame means always use a new window. Some users would prefer that to --reuse-frame.
  • We have to specify one of --reuse-frame and --create-frame, because the default is to use the TTY, which I think we definitely don't want.

I'd personally be in favour of naming this entry "Emacs", and removing the existing entry, so that emacsclient is always used for Emacs. That would be opinionated, though, and I have already lost that argument elsewhere.

`emacsclient` asks an existing Emacs process to open the file.  For many users, this is likely to be more appropriate than the existing Emacs option, which always starts a new `emacs` process to edit the email.
@Frederick888 Frederick888 merged commit e32a472 into Frederick888:master Jan 30, 2025
9 checks passed
@Frederick888
Copy link
Owner

Thanks again! Hopefully I can have some time this weekend to publish a new version :)

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