about summary refs log tree commit diff
path: root/tools/eaglemode/commands/emacsclient.nix
blob: d5aacd137fdc633abbf8cab39ee534a24cc3e9f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
  '';
}