Skip to content

Commit 48996e3

Browse files
committed
Don't load any optional dependencies at compile-time only
Instead rely on `declare-function' and variable declarations. Closes #112.
1 parent 3bd620d commit 48996e3

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

default.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ELS = $(PKG).el
66
ELCS = $(ELS:.el=.elc)
77

88
DEPS = compat
9+
DEPS += vterm
910

1011
DOMAIN ?= magit.vc
1112
CFRONT_DIST ?= E2LUHBKU1FBV02

lisp/with-editor.el

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,16 @@
8383
(require 'shell)
8484
(eval-when-compile (require 'subr-x))
8585

86-
(eval-when-compile
87-
(progn (require 'dired nil t)
88-
(require 'eshell nil t)
89-
(require 'term nil t)
90-
(condition-case err
91-
(require 'vterm nil t)
92-
(error (message "Error(vterm): %S" err)))
93-
(require 'warnings nil t)))
94-
(declare-function dired-get-filename 'dired)
95-
(declare-function term-emulate-terminal 'term)
96-
(declare-function vterm-send-return 'vterm)
97-
(declare-function vterm-send-string 'vterm)
86+
(declare-function dired-get-filename "dired"
87+
(&optional localp no-error-if-not-filep))
88+
(declare-function term-emulate-terminal "term" (proc str))
89+
(declare-function vterm-send-return "vterm" ())
90+
(declare-function vterm-send-string "vterm" (string &optional paste-p))
9891
(defvar eshell-preoutput-filter-functions)
9992
(defvar git-commit-post-finish-hook)
10093
(defvar vterm--process)
94+
(defvar warning-minimum-level)
95+
(defvar warning-minimum-log-level)
10196

10297
;;; Options
10398

@@ -884,6 +879,7 @@ else like the former."
884879
"Debug configuration issues.
885880
See info node `(with-editor)Debugging' for instructions."
886881
(interactive)
882+
(require 'warnings)
887883
(with-current-buffer (get-buffer-create "*with-editor-debug*")
888884
(pop-to-buffer (current-buffer))
889885
(erase-buffer)

0 commit comments

Comments
 (0)