From 4a4c21482b4856da069cb7163262db5cf9c6221e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 28 Aug 2024 00:48:31 +0300 Subject: [PATCH] feat(tools/eaglemode): add command for opening Emacsclient Adds a command that opens the current target in the file browser in Emacsclient. Change-Id: Idbbec3905eb7763ce5bdc2931415db74bc5a5c31 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12367 Tested-by: BuildkiteCI Reviewed-by: emery Reviewed-by: azahi --- tools/eaglemode/commands/emacsclient.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tools/eaglemode/commands/emacsclient.nix diff --git a/tools/eaglemode/commands/emacsclient.nix b/tools/eaglemode/commands/emacsclient.nix new file mode 100644 index 000000000..d5aacd137 --- /dev/null +++ b/tools/eaglemode/commands/emacsclient.nix @@ -0,0 +1,21 @@ +{ depot, pkgs, ... }: + +depot.tools.eaglemode.mkCommand { + name = "Emacsclient"; + hotkey = "Ctrl+E"; + + description = '' + Open target in Emacsclient. + + Emacs server must be running already for this to have any effect. + ''; + + code = '' + ErrorIfNotSingleTarget(); + + my @tgt=GetTgt(); + my $dir=$tgt[0]; + + ExecOrError('${pkgs.emacs}/bin/emacsclient', '-n', $dir); + ''; +}