[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy 664f52c 072/133: Improved missing async func
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy 664f52c 072/133: Improved missing async function error and replaced require with autoload |
Date: |
Sat, 27 Mar 2021 14:48:46 -0400 (EDT) |
branch: externals/ssh-deploy
commit 664f52c264801653eabaad015cbed011a8e191cd
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Improved missing async function error and replaced require with autoload
---
ssh-deploy-diff-mode.el | 2 --
ssh-deploy-test.el | 2 --
ssh-deploy.el | 42 +++++++++++++++++++-----------------------
3 files changed, 19 insertions(+), 27 deletions(-)
diff --git a/ssh-deploy-diff-mode.el b/ssh-deploy-diff-mode.el
index 39c3d21..52abf6f 100644
--- a/ssh-deploy-diff-mode.el
+++ b/ssh-deploy-diff-mode.el
@@ -170,7 +170,6 @@
(defun ssh-deploy-diff-mode--copy-b (parts)
"Perform an download of remote-path to local-path based on PARTS from
section B or section BOTH."
- (require 'ssh-deploy)
(let* ((section (nth 1 parts))
(file-name (nth 0 parts))
(root-local (file-truename (nth 2 parts)))
@@ -214,7 +213,6 @@
(defun ssh-deploy-diff-mode--open (parts)
"Perform a open file action based on PARTS from section A or section B."
- (require 'ssh-deploy)
(let* ((section (nth 1 parts))
(file-name (nth 0 parts))
(root-local (file-truename (nth 2 parts)))
diff --git a/ssh-deploy-test.el b/ssh-deploy-test.el
index a1a9dc0..bd36006 100644
--- a/ssh-deploy-test.el
+++ b/ssh-deploy-test.el
@@ -46,8 +46,6 @@
(defun ssh-deploy-test--download ()
"Test downloads."
- (require 'ediff-util)
-
(let ((directory-a (expand-file-name "test-a/"))
(directory-b (expand-file-name "test-b/")))
diff --git a/ssh-deploy.el b/ssh-deploy.el
index ce3197c..373b689 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -133,10 +133,15 @@
;;; Code:
+(autoload 'ediff-same-file-contents "ediff-util")
+(autoload 'string-remove-prefix "subr-x")
+(autoload 'eshell "eshell")
+(autoload 'shell "shell")
(autoload 'ssh-deploy-diff-mode "ssh-deploy-diff-mode")
(autoload 'ssh-deploy-hydra "ssh-deploy-hydra")
+
(defgroup ssh-deploy nil
"Upload, download, difference, browse and terminal handler for files and
directories on remote hosts via Tramp."
:group 'tools
@@ -287,18 +292,19 @@
(defun ssh-deploy--async-process (start &optional finish async-with-threads)
"Asynchronously do START and then optionally do FINISH, use multi-treading
if ASYNC-WITH-THREADS is above 0 otherwise use multi processes via async.el."
- (if (and (fboundp 'make-thread)
- async-with-threads
+ (if (and async-with-threads
(> async-with-threads 0))
- (make-thread (lambda()
- (let ((ssh-deploy-async 0)
- (ssh-deploy-async-with-threads 0)
- (ssh-deploy-on-explicit-save 0)
- (ssh-deploy-automatically-detect-remote-changes 0))
- (if start
- (let ((result (funcall start)))
- (if finish
- (funcall finish result)))))))
+ (if (fboundp 'make-thread)
+ (make-thread (lambda()
+ (let ((ssh-deploy-async 0)
+ (ssh-deploy-async-with-threads 0)
+ (ssh-deploy-on-explicit-save 0)
+ (ssh-deploy-automatically-detect-remote-changes
0))
+ (if start
+ (let ((result (funcall start)))
+ (if finish
+ (funcall finish result)))))))
+ (display-warning 'ssh-deploy "make-thread function are not
available!"))
(if (fboundp 'async-start)
(when start
(let ((ftp-netrc nil))
@@ -311,10 +317,11 @@
(ssh-deploy-on-explicit-save 0)
(ssh-deploy-automatically-detect-remote-changes 0))
(if ftp-netrc
+ ;; Pass ange-ftp setting to asynchronous process
(defvar ange-ftp-netrc-filename ftp-netrc))
(funcall start)))
finish)))
- (display-warning 'ssh-deploy "Neither make-thread nor async-start
functions are available!"))))
+ (display-warning 'ssh-deploy "async-start functions are not
available!"))))
(defun ssh-deploy--mode-line-set-status-and-update (status &optional filename)
"Set the mode line STATUS in optionally in buffer visiting FILENAME."
@@ -416,7 +423,6 @@
(when (> ssh-deploy-verbose 0) (message "Uploading file '%s' to
'%s'.. (asynchronously)" path-local path-remote))
(ssh-deploy--async-process
(lambda()
- (require 'ediff-util)
(if (fboundp 'ediff-same-file-contents)
(if (or (> force 0) (not (file-exists-p path-remote)) (and
(file-exists-p revision-path) (ediff-same-file-contents revision-path
path-remote)))
(progn
@@ -449,7 +455,6 @@
(ssh-deploy--mode-line-set-status-and-update ssh-deploy--status-uploading)
(if file-or-directory
(progn
- (require 'ediff-util)
(if (fboundp 'ediff-same-file-contents)
(if (or (> force 0)
(not (file-exists-p path-remote))
@@ -515,7 +520,6 @@
(defun ssh-deploy--diff-directories-data (directory-a directory-b exclude-list)
"Find difference between DIRECTORY-A and DIRECTORY-B but exclude paths
matching EXCLUDE-LIST."
;; (message "Comparing a: %s to b: %s" directory-a directory-b)
- (require 'subr-x)
(if (fboundp 'string-remove-prefix)
(if (and (file-directory-p directory-a)
(file-directory-p directory-b))
@@ -596,7 +600,6 @@
files-b-relative-list)
;; Collect files that differ in contents and have equal contents
- (require 'ediff-util)
(when (fboundp 'ediff-same-file-contents)
(mapc
(lambda (file)
@@ -679,7 +682,6 @@
;;;###autoload
(defun ssh-deploy-diff-files (file-a file-b)
"Find difference between FILE-A and FILE-B."
- (require 'ediff-util)
(if (fboundp 'ediff-same-file-contents)
(progn
(message "Comparing file '%s' to '%s'.." file-a file-b)
@@ -750,7 +752,6 @@
(lambda()
(if (file-exists-p path-remote)
(progn
- (require 'ediff-util)
(if (fboundp 'ediff-same-file-contents)
(if (ediff-same-file-contents
revision-path path-remote)
(list 0 (format "Remote file '%s'
has not changed. (asynchronously)" path-remote) path-local)
@@ -779,7 +780,6 @@
;; Does remote file exist?
(if (file-exists-p path-remote)
(progn
- (require 'ediff-util)
(if (fboundp 'ediff-same-file-contents)
(if (ediff-same-file-contents revision-path
path-remote)
(when (> ssh-deploy-verbose 0) (message
"Remote file '%s' has not changed. (synchronously)" path-remote))
@@ -804,7 +804,6 @@
;; Does remote file exist?
(if (file-exists-p path-remote)
(progn
- (require 'ediff-util)
(if (fboundp 'ediff-same-file-contents)
(if (ediff-same-file-contents path-local
path-remote)
(progn
@@ -831,7 +830,6 @@
;; Does remote file exist?
(if (file-exists-p path-remote)
(progn
- (require 'ediff-util)
(if (fboundp 'ediff-same-file-contents)
(if (ediff-same-file-contents path-local
path-remote)
(progn
@@ -989,7 +987,6 @@
(when (and (ssh-deploy--file-is-in-path-p path-local root-local)
(ssh-deploy--file-is-included-p path-local exclude-list))
(let ((path-remote (expand-file-name (ssh-deploy--get-relative-path
root-local path-local) root-remote)))
- (require 'eshell)
(message "Opening eshell on '%s'.." path-remote)
(let ((default-directory path-remote))
(defvar eshell-buffer-name)
@@ -1005,7 +1002,6 @@
(when (and (ssh-deploy--file-is-in-path-p path-local root-local)
(ssh-deploy--file-is-included-p path-local exclude-list))
(let ((path-remote (expand-file-name (ssh-deploy--get-relative-path
root-local path-local) root-remote)))
- (require 'shell)
(message "Opening eshell on '%s'.." path-remote)
(let ((default-directory path-remote)
(explicit-shell-file-name ssh-deploy-remote-shell-executable))
- [elpa] externals/ssh-deploy a5aa5f6 093/133: Run only async test with threads if threads are available, (continued)
- [elpa] externals/ssh-deploy a5aa5f6 093/133: Run only async test with threads if threads are available, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy b8f976a 116/133: Passing verbose flag to diff files function, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e1507fe 119/133: Create FUNDING.yml, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 37a15c6 118/133: fix: ".git" matching, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy d0f7294 121/133: When remote differs only with local-revision, update local-revision [#61], Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e133963 125/133: Default exclude value for DirectoryVariables now matches only .dir-locals.el, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 168c66d 114/133: Updated .gitignore to ignore test-generated files, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 93a0e18 128/133: Resolved hydra declaration if hydra is not installed, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 89bb950 131/133: Merge pull request #69 from housensen/patch-1, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 7a5a087 066/133: Updated version, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 664f52c 072/133: Improved missing async function error and replaced require with autoload,
Stefan Monnier <=
- [elpa] externals/ssh-deploy 8c354e1 092/133: Added Travis CI file to repo, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy f61f1ef 041/133: Fixed bug where all DirectoryVariables was not passed on from handlers, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy a1a9d3c 051/133: Work on lisp code styling with (if), (progn) and (when), Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e0bf686 054/133: More (if), (when) and (progn) optimizations, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy efc8be3 058/133: Added another example using plug-in functions from script, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 4044f78 064/133: Hydra compilation working, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy ae5354a 065/133: Fixed issue were remote paths with symlinks didn't work with recursive diff function, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 6e37aae 067/133: Added unit test for download, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 8107b9e 073/133: Added unit test for rename and delete, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e895d6d 079/133: Replaced asynchronous (require) with (autoload), Stefan Monnier, 2021/03/27