1 ! Copyright (C) 2022 nomennescio
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: combinators.short-circuit continuations editors editors.emacs
4 io.pathnames io.standard-paths kernel make math.parser
5 namespaces sequences system windows.advapi32 windows.registry ;
6 IN: editors.emacs.windows
8 CONSTANT: registry-path-to-emacs "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\emacs.exe"
10 M: windows find-emacsclient
12 [ [ HKEY_LOCAL_MACHINE registry-path-to-emacs "" query-registry
13 parent-directory "emacsclientw.exe" append-path ] [ drop f ] recover ]
14 [ { "Emacs" } "emacsclientw.exe" find-in-applications ]
15 [ { "Emacs" } "emacsclient.exe" find-in-applications ]