Hi Rodrigo,

On Sun, Mar 5, 2023 at 11:53 AM Rodrigo Morales
<[email protected]> wrote:
>
> | (setenv "EDITOR"         "emacsclient")

I keep the small Guile script below in ~/.config/editor/always-emacs
and set EDITOR to that (in init.el).

Kind regards
Felix Lechner

* * *

#!/usr/bin/env guile
!#

(let* ((arguments (cdr (command-line)))
       (inside-emacs (getenv "INSIDE_EMACS"))
       (emacs-command (if (string-contains (or inside-emacs "") "comint")
              (append '("emacsclient") arguments)
              (append '("emacsclient" "--create-frame") arguments))))
  (apply execlp emacs-command))

Reply via email to