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

Problem with jrnl and emacsclient at emacs server start #369

Closed
Niols opened this issue Jul 8, 2015 · 6 comments
Closed

Problem with jrnl and emacsclient at emacs server start #369

Niols opened this issue Jul 8, 2015 · 6 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists 🔒 Outdated needs more info Further information is requested stale Inactive issue: will be closed soon if no activity

Comments

@Niols
Copy link

Niols commented Jul 8, 2015

Hi,

Firstly I really like this command line tool, thanks a lot for it.

I still have a little problem with editing it in editor. My editor is emacs, and I use it in server mode. My $EDITOR var is the following:

emacsclient -nw -a ""
  • emacsclient is a little part of emacs that just tries to connect to the emacs server
  • -nw means no-window (because I like to use emacs in terminal and not in graphic mode)
  • -a "" means that there's no alternate editor. This means that if emacs server isn't found, instead of using an alternate editor, emacs client tries to launch it.

This emacs installation is working pretty well, and I'm using it since months. With jrnl however, I encounter a little problem:

If emacs server has not been started, and if I write jrnl or jrnl --edit, I get the following:

[niols@tosh ~]$ jrnl 
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: error executing alternate editor """"
[Nothing saved to file]
2015-07-08 19:42 test

instead of the usual:

[niols@tosh ~]$ emacs 
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".

Warning: due to a long standing Gtk+ bug
http://bugzilla.gnome.org/show_bug.cgi?id=85715
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
Loading time...
Loading time...done
Loading paren...
Loading paren...done
Starting Emacs daemon.
Emacs daemon should have started, trying to connect again

So there must be something in the way you're calling the editor that emacs doesn't like. There's no problem when the emacs server has already been started.

This is not a prioritary bug, considering how few people this must concern and how easy it is to fix it (just start emacs server…). I'm using emacs 24.5, python 3.4.3 on archlinux.

@stale
Copy link

stale bot commented Jul 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 7, 2019
@wren wren added bug Something isn't working needs more info Further information is requested labels Jul 24, 2019
@wren
Copy link
Member

wren commented Jul 24, 2019

I wonder if this is related to #581. @Niols, I assume you were using v1.9.8 for this bug report. Is that correct? Can you paste your config in here for a deeper look, please?

@wren wren removed the stale label Jul 29, 2019
@gregorybodnar
Copy link
Contributor

I've been having a bit of a look at #435 , which attempts to address #581 . shlex.split is consuming the quotes in both cases.

>>> import shlex
>>> invocation = 'emacsclient -nw -a ""'
>>> shlex.split(invocation)
['emacsclient', '-nw', '-a', '']

The double quotes that specify the alternate are getting stripped. There's an empty string left in the sequence that's passed to subprocess.call, but I don't have a firm grasp of what might be happening between the construction and the execution of the command when operating on a sequence. If it's being converted to a string, you'd get something like this:

>>> ' '.join(shlex.split(invocation))
'emacsclient -nw -a '

I expect that any respectable shell would fail to pass an empty argument after the -a.

@stale
Copy link

stale bot commented Oct 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Inactive issue: will be closed soon if no activity label Oct 12, 2019
@wren
Copy link
Member

wren commented Oct 15, 2019

The way we parse the editor config needs some work. I think this issue is the same as #581, so I'm closing as duplicate for now. Feel free to reopen if the other issue doesn't solve it.

@wren wren closed this as completed Oct 15, 2019
@wren wren added the duplicate This issue or pull request already exists label Oct 15, 2019
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the 🔒 Outdated label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working duplicate This issue or pull request already exists 🔒 Outdated needs more info Further information is requested stale Inactive issue: will be closed soon if no activity
Projects
None yet
Development

No branches or pull requests

3 participants