-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
emacsclient doesn't work with emacs daemon active #10145
Comments
I have no idea of how emacs works, but in JabRef you can specify extra command line arguments for emacs: When I interpret that here right passing -q. should avoid loading the init config |
Unfortunately, I don't quite know how emacs works either. Option |
I've got no idea what is jabref (saw your call for help on Mastodon), though i noticed something suspicious in the your original post: You mentioned That explains why only Does that make sense? Can you confirm this? |
@Doc73 So it's either a misconfiguration of the daemon like @bahmanm said. If that doesn't work: Maybe JabRef could report or log the |
I'm not at my PC and reply to you by memory, but I can say that the issue
depends on the fact that the daemon is running.
Yes, I could disable the daemon by systemctl or kill it, and then let start
server by Emacs configuration file or start it manually.
Surely, if daemon is running, Emacs server can't start at all and, without
server, Jabref can't send citation commands to Emacs.
I hope I was clearer.
Il gio 17 ago 2023, 21:18 Christian Tietze ***@***.***> ha
scritto:
… @Doc73 <https://github.com/Doc73> emacsclient is the tool to tell the
daemon to do stuff, like open a file (using emacs directly would start
the program again).
So it's either a misconfiguration of the daemon like @bahmanm
<https://github.com/bahmanm> said.
If that doesn't work: Maybe JabRef could report or log the emacsclient
exit code?
—
Reply to this email directly, view it on GitHub
<#10145 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ65FCDNDA7TJ67WPK6JYTXVZVBRANCNFSM6AAAAAA3GXRYAA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
To make sure it's not something related to systemd, please run the following:
And then try what you were doing again. HTH |
Yes, I did also this test.
and Jabref doesn't send any citations
|
Thanks for checking that out. I think, at this stage, we need to figure out what goes wrong when starting the daemon. Can you please try the following experiments and post back the output here? Experiment 1
Experiment 2
|
Experiment 1Experiment 2 |
Thanks @Doc73 for the files. That rules out any possible problem w/ the daemon startup ✔️ @Siedlerchr Reading the comments, my understanding is that when you "send to Emacs" you're sending a ELisp expression to Emacs to evaluate. If that's right, is there a way to see the result of the interaction w/ emacsclient and any possible errors/warnings on JabRef side? @Doc73 Following up on the above, can you start the daemon via systemctl, try to send something to Emacs from JabRef and then check the There has got to be a trace somewhere! |
@bahmanm Here is the command and the exeuction we send: jabref/src/main/java/org/jabref/gui/push/PushToEmacs.java Lines 58 to 106 in 03b3f25
The logs under Help -> View log should contain error/warning in case |
@bahmanm BTW, I started Emacs without loading the server via configuration file: JabRef doesn't send anything, but according Help -> View Logs the app sent the citation command. In short, it would have worked, even if nothing happened! Really, I don't know how to proceed, other than the above ways:
|
OK, thanks. Can you also let me know how do you invoke Emacs client? What are the switches/options? That is, the following command inserted "Hello, world" in
Can you try running Emacs via systemctl and sending the command from JabRef. Then open a client and check |
By default, the additional command line arguments are Starting itself is done using Java's Process Builder which, under the hood, calls the native OS implementation. I can also build a new version which contains some more log output of the full command that is sent to Emacs if that helps. |
Noted @Siedlerchr. At this stage, I think it's best if I installed JabRef on my machine. Can you share a sample TeX file w/ bibitems (I've got no idea what is that) so I can try to reproduce @Doc73's problem locally.? |
You can download our sample file: https://github.com/JabRef/jabref/blob/main/src/test/resources/testbib/jabref-authors.bib You can download JabRef's deb file. https://github.com/JabRef/jabref/releases/tag/v5.9 (BibTeX and biblatex are text-based format for citations/references in LaTeX and JabRef is a GUI for managing and collecting this) |
Thanks. This works OOTB w/ Emacs run via systemd 🤔 @Doc73 In addition to checking
|
In short: emacs daemon is not compatible with |
@Doc73 Were you able to see |
@bahmanm |
Maybe it's a different emacs version? |
Emacs 29.1 https://packages.debian.org/sid/emacs Thursday or Friday I'll do some tests with the version of Debian Stable (where I remember there wasn't issues) |
Same version here @Doc73 🤔 |
Just to clarify: the "Emacs daemon" is an Emacs process that starts an "Emacs server". So it's not either/or. Maybe part of the problem is in "Start Emacs and open a txt file": you should "start Emacs" with emacsclient (so it contacts the daemon) otherwise that will create a fresh new Emacs session which can't start its own process because it collides with the Emacs daemon's server. |
@monnier I'll do other tests, now |
@Doc73 Probably I'm missing something but I noticed in both recordings that you run "Emacs (GUI)" which is NOT equal to "Emacs Client". That starts a standalone Emacs w/ no server. Can you try running "Emacs (Client)" and check the results? |
@bahmanm Here is an abstract of
The first command returns an error ( |
@Doc73 That shouldn't happen 🤔 The application "Emacs (Client)" should open an instance of the client whether you've run the daemon via systemd or Let's try this and see what happens:
Then try to send something to Emacs. Screencast.from.2023-08-24.03-20-57.webm |
@bahmanm Here the result of On Stable:
On Sid:
As a result, everything works fine on Stable: I can send citations from JabRef both to Emacs (Client) and to Emacs (GUI). Remember that Emacs (Client) on Sid does not start anything, at least in my PC! However the commands you indicated (in Sid)
start the windows of Emacs which regularly receives the cites from Jabref! In short, in this case everything works perfectly! |
Oh, great that you did the extra test 👍 @Doc73 @Siedlerchr Uh, do you folks think my work here helping w/ Emacs'y things is done? |
JabRef version
5.9 (latest release)
Operating system
GNU / Linux
Details on version and operating system
Debian Sid Gnome (but perhaps also on Bookworm)
Checked with the latest development build
Steps to reproduce the behaviour
Appendix
This issue is related with
/usr/lib/systemd/user/emacs.service
active, wich conflicts with(server-start)
active on~/.emacs.d/init.el
.On my part, I could alternatively:
/usr/lib/systemd/user/emacs.service
withsystemctl
emacs.service
and start the server whenever I need itSome link on emacs:
But, my quaestion is: is it possible to adapt JabRef to communicate with the daemon instead of emacsclient?
I'm sorry for the difficult question, perhaps not solvable, and thank you very much in advance.
Domenico
The text was updated successfully, but these errors were encountered: