Closed samyakbardiya closed 2 years ago
what about just using emacsclient
? I'm an emacs user also
@clearloop, then this error comes up:
$ leetcode edit 1
emacsclient: can't find socket; have you started the server?
emacsclient: To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor. Please use:
--socket-name
--server-file (or environment variable EMACS_SERVER_FILE)
--alternate-editor (or environment variable ALTERNATE_EDITOR)
that's why -s doom
is important, it solves this error.
I have tried every other options but all them gave the same error, the previous one.
I have tried -c
, -nw
& -nc
along with -s doom
; but no success.
that's why -s doom is important, it solves this error.
hi @samyak039 !, have you run emacs --daemon
before emacsclient
?
yeah of cource. it's in my xinit file.
edit: I forgot to mention, if I open the file manually it working fine.
$ emacsclient -n -s doom <file>
hmmm, my editor config is just emacsclient
[code]
editor = 'emacsclient'
lang = 'rust'
pick = '${fid}.${slug}'
submission = '${fid}.${slug}.${sid}.${ac}'
and it works fine...the code of using editor is here https://github.com/clearloop/leetcode-cli/blob/2b373c0eee7824d96f13353cbe7ff53828db5815/src/cmds/edit.rs#L102, not sure if this could help
maybe I found the issue, it is that your editor command is unable to deal with the options given to it.
I tested it:
nvim
working but nvim -o
not workingbat
working but bat -p
not workingemacsclient
is working, but mine emacsclient -s doom
is nothence the issue is that the rust command is unable to parse the option given in the editor command.
PS. I cannot open any file if I don't give -s doom
along with the command, ig this is happening because I am using chemacs2
maybe I found the issue, it is that your editor command is unable to deal with the options given to it.
exactly, and we mb can update the command to sth like
let editor_with_args = conf.code.editor.split(" ");
// do some checking stuffs
let mut editor_args = editor_with_args[0..];
editor_args.push(file_name);
std::process::Command::new(editor_with_args[0]).args(editor_args);
sorry I don't know any rust :)
sorry I don't know any rust :)
nevermind, I can fix this on this weekend
thanks @clearloop :)
This update haven't applied to the latest version yet since there are some bugs in 0.3.12
I am trying to open via
leetcode edit <ID>
command, it is working fine withvim
,nvim
& evenemacs
but does not open the file withemacsclient
it gives error:here's my
leetcode.toml
Note:
emacsclient
is the command to use emacs in daemon-client mode.