emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/with-editor 48996e3116 2/2: Don't load any optional depend


From: ELPA Syncer
Subject: [nongnu] elpa/with-editor 48996e3116 2/2: Don't load any optional dependencies at compile-time only
Date: Tue, 3 May 2022 07:59:07 -0400 (EDT)

branch: elpa/with-editor
commit 48996e3116dadee06c8c68b1a0fe6ad8fd5317e0
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Don't load any optional dependencies at compile-time only
    
    Instead rely on `declare-function' and variable declarations.
    
    Closes #112.
---
 default.mk          |  1 +
 lisp/with-editor.el | 20 ++++++++------------
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/default.mk b/default.mk
index 4e2755e6ce..f152f45afd 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 716c47475d..dd65d00aee 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]