[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy 54ec0d2 023/133: Updated mode-line logic for
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy 54ec0d2 023/133: Updated mode-line logic for deletions |
Date: |
Sat, 27 Mar 2021 14:48:36 -0400 (EDT) |
branch: externals/ssh-deploy
commit 54ec0d2a6ec514029a53824f967df76232cfbd86
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Updated mode-line logic for deletions
---
ssh-deploy-diff-mode.el | 5 +++--
ssh-deploy.el | 53 +++++++++++++++++++++++--------------------------
2 files changed, 28 insertions(+), 30 deletions(-)
diff --git a/ssh-deploy-diff-mode.el b/ssh-deploy-diff-mode.el
index 502e30f..58b1c75 100644
--- a/ssh-deploy-diff-mode.el
+++ b/ssh-deploy-diff-mode.el
@@ -3,8 +3,8 @@
;; Author: Christian Johansson <github.com/cjohansson>
;; Maintainer: Christian Johansson <github.com/cjohansson>
;; Created: 1 Feb 2018
-;; Modified: 23 Feb 2018
-;; Version: 1.14
+;; Modified: 29 Oct 2018
+;; Version: 1.15
;; Keywords: tools, convenience
;; URL: https://github.com/cjohansson/emacs-ssh-deploy
@@ -216,6 +216,7 @@
(t "Copy B is not available in this section"))
(display-warning 'ssh-deploy "Function ssh-deploy-download is missing"
:warning))))
+;; TODO Should we really pass path as buffer argument in this?
(defun ssh-deploy-diff-mode--delete (parts)
"Delete path in both, only in a or only in b based on PARTS from section A,
B or BOTH."
(require 'ssh-deploy)
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 7818ac6..c386268 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -3,8 +3,8 @@
;; Author: Christian Johansson <christian@cvj.se>
;; Maintainer: Christian Johansson <christian@cvj.se>
;; Created: 5 Jul 2016
-;; Modified: 27 Oct 2018
-;; Version: 2.01
+;; Modified: 29 Oct 2018
+;; Version: 2.02
;; Keywords: tools, convenience
;; URL: https://github.com/cjohansson/emacs-ssh-deploy
@@ -904,14 +904,13 @@
;; File is not inside root or is excluded from it
(when (> ssh-deploy-debug 0) (message "File %s is not in root or is
excluded from it." path-local)))))
-(defun ssh-deploy-delete (path &optional async buffer async-with-threads)
- "Delete PATH and use flags ASYNC, set status in BUFFER. Use multi-threading
if ASYNC-WITH-THREADS is above zero."
+(defun ssh-deploy-delete (path &optional async async-with-threads)
+ "Delete PATH and use flags ASYNC. Use multi-threading if ASYNC-WITH-THREADS
is above zero."
(let ((async (or async ssh-deploy-async))
(async-with-threads (or async-with-threads
ssh-deploy-async-with-threads)))
(if (> async 0)
(progn
- (when buffer
- (ssh-deploy--mode-line-set-status-and-update
ssh-deploy--status-deleting buffer))
+ (ssh-deploy--mode-line-set-status-and-update
ssh-deploy--status-deleting path)
(ssh-deploy--async-process
(lambda()
(if (file-exists-p path)
@@ -920,8 +919,8 @@
(if file-or-directory
(delete-file path t)
(delete-directory path t t))
- (list path 0 buffer)))
- (list path 1 buffer)))
+ (list path 0 path)))
+ (list path 1 path)))
(lambda(response)
(when (nth 2 response)
(ssh-deploy--mode-line-set-status-and-update
ssh-deploy--status-idle (nth 2 response))
@@ -932,35 +931,33 @@
(t (display-warning 'ssh-deploy (format "Did not find '%s'
for deletion. (asynchronously)" (nth 0 response)) :warning))))
async-with-threads))
(if (file-exists-p path)
- (ssh-deploy--mode-line-set-status-and-update
ssh-deploy--status-deleting buffer)
- (let ((file-or-directory (not (file-directory-p path))))
- (when buffer
- (ssh-deploy--mode-line-set-status-and-update
ssh-deploy--status-deleting buffer))
- (progn
- (if file-or-directory
- (delete-file path t)
- (delete-directory path t t))
- (when buffer
- (ssh-deploy--mode-line-set-status-and-update
ssh-deploy--status-idle buffer)
- (let ((local-buffer (find-buffer-visiting buffer)))
+ (let ((file-or-directory (not (file-directory-p path))))
+ (ssh-deploy--mode-line-set-status-and-update
ssh-deploy--status-deleting path)
+ (progn
+ (if file-or-directory
+ (delete-file path t)
+ (delete-directory path t t))
+ (ssh-deploy--mode-line-set-status-and-update
ssh-deploy--status-idle path)
+ (let ((local-buffer (find-buffer-visiting path)))
(when local-buffer
- (kill-buffer local-buffer))))
- (message "Completed deletion of '%s'. (synchronously)" path)))
+ (kill-buffer local-buffer)))
+ (message "Completed deletion of '%s'. (synchronously)" path)))
(display-warning 'ssh-deploy (format "Did not find '%s' for deletion.
(synchronously)" path) :warning)))))
;;;###autoload
-(defun ssh-deploy-delete-both (path-local &optional root-local root-remote
async debug exclude-list)
- "Delete PATH-LOCAL relative to ROOT-LOCAL as well as on ROOT-REMOTE, do it
asynchronously if ASYNC is non-nil, debug if DEBUG is non-nil, check if path is
excluded in EXCLUDE-LIST."
+(defun ssh-deploy-delete-both (path-local &optional root-local root-remote
async debug exclude-list async-with-threads)
+ "Delete PATH-LOCAL relative to ROOT-LOCAL as well as on ROOT-REMOTE, do it
asynchronously if ASYNC is non-nil, debug if DEBUG is non-nil, check if path is
excluded in EXCLUDE-LIST. Use async threads is ASYNC-WITH-THREADS is above
zero."
(let ((root-local (or root-local ssh-deploy-root-local))
(root-remote (or root-remote ssh-deploy-root-remote))
(async (or async ssh-deploy-async))
(debug (or debug ssh-deploy-debug))
- (exclude-list (or exclude-list ssh-deploy-exclude-list)))
+ (exclude-list (or exclude-list ssh-deploy-exclude-list))
+ (async-with-threads (or async async-with-threads)))
(if (and (ssh-deploy--file-is-in-path path-local root-local)
(ssh-deploy--file-is-included path-local exclude-list))
(let ((path-remote (expand-file-name (ssh-deploy--get-relative-path
root-local path-local) root-remote)))
- (ssh-deploy-delete path-local async path-local)
- (ssh-deploy-delete path-remote async path-local))
+ (ssh-deploy-delete path-local async async-with-threads)
+ (ssh-deploy-delete path-remote async async-with-threads))
(when (> debug 0) (message "Path '%s' is not in the root '%s' or is
excluded from it." path-local root-local)))))
;;;###autoload
@@ -1242,14 +1239,14 @@
(root-local (file-truename ssh-deploy-root-local))
(yes-no-prompt (read-string (format "Type 'yes' to confirm
that you want to delete the file '%s': " path-local))))
(if (string= yes-no-prompt "yes")
- (ssh-deploy-delete-both path-local root-local
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug)))
+ (ssh-deploy-delete-both path-local root-local
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug
ssh-deploy-async-with-threads)))
(if (and (ssh-deploy--is-not-empty-string default-directory)
(file-exists-p default-directory))
(let* ((path-local (file-truename default-directory))
(root-local (file-truename ssh-deploy-root-local))
(yes-no-prompt (read-string (format "Type 'yes' to confirm
that you want to delete the directory '%s': " path-local))))
(if (string= yes-no-prompt "yes")
- (ssh-deploy-delete-both path-local root-local
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug
ssh-deploy-exclude-list)))))))
+ (ssh-deploy-delete-both path-local root-local
ssh-deploy-root-remote ssh-deploy-async ssh-deploy-debug
ssh-deploy-exclude-list ssh-deploy-async-with-threads)))))))
;;;###autoload
(defun ssh-deploy-rename-handler ()
- [elpa] externals/ssh-deploy 2af7bec 007/133: Mode-line working again after changes, (continued)
- [elpa] externals/ssh-deploy 2af7bec 007/133: Mode-line working again after changes, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy ad12e19 008/133: Run deployment script working again after lexical-binding, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy cb792e8 002/133: Added ELPA to description and changed http references to https, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 71796c3 006/133: Optimization for menu-code completed, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 6fbc09f 010/133: Various changes relating to changing optional boolean argument to, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy b93b944 009/133: Updated README for optional threading and mode-line, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy d934ef8 017/133: More work on optional booleans to integers, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy edee8df 019/133: Improved documentation, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 4073f79 014/133: Updated documentation to suggest ~/.authinfo.gpg usage, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 2048399 021/133: Passing async-with-threads to directory diff, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 54ec0d2 023/133: Updated mode-line logic for deletions,
Stefan Monnier <=
- [elpa] externals/ssh-deploy fbc6e85 025/133: Created predefined hydra, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 947a3c7 024/133: Improved usability with pre-defined hooks, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 20ce7f2 026/133: Created a pred-fined prefix map and hydra map, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy a12e59f 027/133: Updated comments, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy c1f8837 029/133: Updated documentation with pre-defined hydra and pre-fix map, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy d548011 036/133: Fixed bug with constant definition, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy d853e2f 040/133: Fixed issue with passing local variables to diff-mode, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 98c00bb 042/133: Fixed bug with synchronous forced uploads, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 103588b 050/133: Running custom script asynchronously loads ssh-deploy library, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 2b3a531 012/133: Updated date, Stefan Monnier, 2021/03/27