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 <emery@dmz.rs>
Reviewed-by: azahi <azat@bahawi.net>
This commit is contained in:
Vincent Ambo 2024-08-28 00:48:31 +03:00 committed by tazjin
parent d235fd99c2
commit 4a4c21482b

View file

@ -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);
'';
}