magit / with-editor

Use the Emacsclient as the $EDITOR of child processes
http://magit.vc/manual/with-editor
GNU General Public License v3.0
185 stars 45 forks source link

when-let is not known to be defined #83

Closed Zulu-Inuoe closed 3 years ago

Zulu-Inuoe commented 3 years ago

When compiling with-editor.el I got compiler warnings about a free variable v:

In with-editor-export-editor:
with-editor.el:702:23:Warning: `(v (getenv envvar))' is a malformed function
with-editor.el:702:23:Warning: `(v (getenv "EMACS_SERVER_FILE"))' is a
    malformed function
with-editor.el:729:70:Warning: reference to free variable `v'

In end of data:
with-editor.el:936:1:Warning: the function `when-let' is not known to be
    defined.

when-let is defined in subr-x.el (at least on Emacs 26.3).

I believe the fix would be to add the following:

(eval-when-compile (require 'subr-x))

to the top of with-editor.el