summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2022-05-03 13:24:21 +0200
committerJonas Bernoulli <jonas@bernoul.li>2022-05-03 13:24:21 +0200
commit48996e3116dadee06c8c68b1a0fe6ad8fd5317e0 (patch)
tree18f410ddeef1f5d6698c3a94267ca9308223bd8b
parent3bd620d464f756c7267094660a1373bc48d2b42f (diff)
Don't load any optional dependencies at compile-time only
Instead rely on `declare-function' and variable declarations. Closes #112.
-rw-r--r--default.mk1
-rw-r--r--lisp/with-editor.el20
2 files changed, 9 insertions, 12 deletions
diff --git a/default.mk b/default.mk
index 4e2755e..f152f45 100644
--- a/default.mk
+++ b/default.mk
@@ -6,6 +6,7 @@ ELS = $(PKG).el
ELCS = $(ELS:.el=.elc)
DEPS = compat
+DEPS += vterm
DOMAIN ?= magit.vc
CFRONT_DIST ?= E2LUHBKU1FBV02
diff --git a/lisp/with-editor.el b/lisp/with-editor.el
index 716c474..dd65d00 100644
--- a/lisp/with-editor.el
+++ b/lisp/with-editor.el
@@ -83,21 +83,16 @@
(require 'shell)
(eval-when-compile (require 'subr-x))
-(eval-when-compile
- (progn (require 'dired nil t)
- (require 'eshell nil t)
- (require 'term nil t)
- (condition-case err
- (require 'vterm nil t)
- (error (message "Error(vterm): %S" err)))
- (require 'warnings nil t)))
-(declare-function dired-get-filename 'dired)
-(declare-function term-emulate-terminal 'term)
-(declare-function vterm-send-return 'vterm)
-(declare-function vterm-send-string 'vterm)
+(declare-function dired-get-filename "dired"
+ (&optional localp no-error-if-not-filep))
+(declare-function term-emulate-terminal "term" (proc str))
+(declare-function vterm-send-return "vterm" ())
+(declare-function vterm-send-string "vterm" (string &optional paste-p))
(defvar eshell-preoutput-filter-functions)
(defvar git-commit-post-finish-hook)
(defvar vterm--process)
+(defvar warning-minimum-level)
+(defvar warning-minimum-log-level)
;;; Options
@@ -884,6 +879,7 @@ else like the former."
"Debug configuration issues.
See info node `(with-editor)Debugging' for instructions."
(interactive)
+ (require 'warnings)
(with-current-buffer (get-buffer-create "*with-editor-debug*")
(pop-to-buffer (current-buffer))
(erase-buffer)