Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 346 lines (295 sloc) 13.963 kB
86a223c @escherdragon +Use lexical bindings.
authored
1 ;;; sunrise-x-loop.el --- asynchronous execution of filesystem operations for the Sunrise Commander File Manager -*- lexical-binding: t -*-
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
2
17c1039 @escherdragon The Sunrise Commander -- version 6
authored
3 ;; Copyright (C) 2008-2012 José Alfredo Romero Latouche.
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
4
dc7b892 @escherdragon +Updated copyright statement.
authored
5 ;; Author: José Alfredo Romero L. <escherdragon@gmail.com>
b236a17 @escherdragon +Added Štěpán to Authors header
authored
6 ;; Štěpán Němec <stepnem@gmail.com>
242b11f @escherdragon +Added Emacs and Emacs Wiki standard headers.
authored
7 ;; Maintainer: José Alfredo Romero L. <escherdragon@gmail.com>
8 ;; Created: 27 Jun 2008
9 ;; Version: 3
17c1039 @escherdragon The Sunrise Commander -- version 6
authored
10 ;; RCS Version: $Rev: 423 $
860266d @stepnem =Conventionalise the `Keywords' library header.
stepnem authored
11 ;; Keywords: sunrise commander, background copy rename move
242b11f @escherdragon +Added Emacs and Emacs Wiki standard headers.
authored
12 ;; URL: http://www.emacswiki.org/emacs/sunrise-x-loop.el
13 ;; Compatibility: GNU Emacs 22+
14
17c1039 @escherdragon The Sunrise Commander -- version 6
authored
15 ;; This file is not part of GNU Emacs.
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
16
17 ;; This program is free software: you can redistribute it and/or modify it under
18 ;; the terms of the GNU General Public License as published by the Free Software
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
19 ;; Foundation, either version 3 of the License, or (at your option) any later
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
20 ;; version.
21 ;;
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
22 ;; This program is distributed in the hope that it will be useful, but WITHOUT
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
23 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
24 ;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more de-
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
25 ;; tails.
26
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
27 ;; You should have received a copy of the GNU General Public License along with
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
28 ;; this program. If not, see <http://www.gnu.org/licenses/>.
29
30 ;;; Commentary:
31
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
32 ;; This extension adds to the Sunrise Commander the capability of performing
33 ;; copy and rename operations in the background. It provides prefixable drop-in
34 ;; replacements for the `sr-do-copy' and `sr-do-rename' commands and uses them
35 ;; to redefine their bindings in the `sr-mode-map' keymap. When invoked the
36 ;; usual way (by pressing C or R), these new functions work exactly as the old
37 ;; ones, i.e. they simply pass the control flow to the logic already provided by
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
38 ;; Sunrise, but when prefixed (e.g. by pressing C-u C or C-u R) they launch a
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
39 ;; separate Elisp intepreter in the background, delegate to it the execution of
40 ;; all further operations and return immediately, so the Emacs UI remains fully
41 ;; responsive while any potentially long-running copy or move tasks can be let
42 ;; alone to eventually reach their completion in the background.
43
44 ;; After all requested actions have been performed, the background interpreter
45 ;; remains active for a short period of time (30 seconds by default, but it can
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
46 ;; be customized), after which it shuts down automatically.
47
48 ;; At any moment you can abort all tasks scheduled and under execution and force
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
49 ;; the background interpreter to shut down by invoking the `sr-loop-stop'
50 ;; command (M-x sr-loop-stop).
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
51
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
52 ;; If you need to debug something or are just curious about how this extension
53 ;; works, you can set the variable `sr-loop-debug' to t to have the interpreter
54 ;; launched in debug mode. In this mode all input and output of background
55 ;; operations are sent to a buffer named *SUNRISE-LOOP*. To return to normal
56 ;; mode set `sr-loop-debug' back to nil and use `sr-loop-stop' to kill the
57 ;; currently running interpreter.
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
58
59 ;; The extension disables itself and tries to do its best to keep out of the way
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
60 ;; when working with remote directories through FTP (e.g. when using ange-ftp),
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
61 ;; since in these cases the execution of file transfers in the background should
62 ;; be managed directly by the FTP client.
63
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
64 ;; It was written on GNU Emacs 23 on Linux, and tested on GNU Emacs 22 and 23
65 ;; for Linux and on EmacsW32 (version 22) for Windows.
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
66
67 ;;; Installation and Usage:
68
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
69 ;; 1) Put this file somewhere in your Emacs `load-path'.
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
70
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
71 ;; 2) Add a (require 'sunrise-x-loop) expression to your .emacs file somewhere
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
72 ;; after the (require 'sunrise-commander) one.
73
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
74 ;; 3) Evaluate the new expression, or reload your .emacs file, or restart Emacs.
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
75
ae1b646 @stepnem =Refill commentary sections with left justification.
stepnem authored
76 ;; 4) The next time you need to copy of move any big files, just prefix the
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
77 ;; appropriate command with C-u.
78
79 ;; 5) Enjoy ;-)
80
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
81 ;; 6) You can use `unload-feature' to get rid of the provided functionality
82 ;; completely.
83
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
84 ;;; Code:
85
11b8688 @stepnem -x-loop, x-mirror: Don't use `eval-when-compile' to require `sunrise-…
stepnem authored
86 (require 'sunrise-commander)
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
87
88 (defcustom sr-loop-debug nil
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
89 "Activate debug mode in the Sunrise Loop extension.
90 When set, the background elisp interpreter is launched in such a
91 way that all background input and output are sent to a buffer
92 named *SUNRISE LOOP* and automatic lifecycle management is
93 disabled (i.e. you have to kill the interpreter manually using
94 sr-loop-stop to get rid of it)."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
95 :group 'sunrise
96 :type 'boolean)
97
98 (defcustom sr-loop-timeout 30
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
99 "Number of seconds to wait while idle before shutting down the interpreter.
100 After executing one or more operations in the background, the
101 Sunrise Loop Elisp interpreter will be killed automatically after
102 this amount of time."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
103 :group 'sunrise)
104
ffc49a6 @escherdragon +Added customizable variable to enable/disable pop-ups
authored
105 (defcustom sr-loop-use-popups t
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
106 "When non-nil, display pop‐up notification when execution queue is emptied."
ffc49a6 @escherdragon +Added customizable variable to enable/disable pop-ups
authored
107 :group 'sunrise
108 :type 'boolean)
109
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
110 (defvar sr-loop-process nil)
111 (defvar sr-loop-timer nil)
112 (defvar sr-loop-scope nil)
06e9ba1 @escherdragon Version 2!
authored
113 (defvar sr-loop-queue nil)
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
114
115 (defun sr-loop-start ()
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
116 "Launch and initiate a new background Elisp interpreter.
117 The new interpreter runs in batch mode and inherits all functions
118 from the Sunrise Commander (sunrise-commander.el) and from this
119 file."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
120 (let ((process-connection-type nil)
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
121 (sr-main (symbol-file 'sr-mode))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
122 (sr-loop (symbol-file 'sr-loop-cmd-loop))
123 (emacs (concat invocation-directory invocation-name)))
124 (setq sr-loop-process (start-process
125 "Sunrise-Loop"
126 (if sr-loop-debug "*SUNRISE-LOOP*" nil)
127 emacs
128 "-batch" "-q" "-no-site-file"
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
129 "-l" sr-main "-l" sr-loop
130 "-eval" "(sr-loop-cmd-loop)"))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
131 (sr-loop-enqueue `(setq load-path (quote ,load-path)))
132 (sr-loop-enqueue '(require 'sunrise-commander))
133 (if sr-loop-debug
134 (sr-loop-enqueue '(setq sr-loop-debug t))
135 (set-process-filter sr-loop-process 'sr-loop-filter))
06e9ba1 @escherdragon Version 2!
authored
136 (setq sr-loop-queue nil)))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
137
138 (defun sr-loop-disable-timer ()
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
139 "Disable the automatic shutdown timer.
140 This is done every time we send a new task to the background
141 interpreter, lest it gets nuked before completing its queue."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
142 (if sr-loop-timer
143 (progn
144 (cancel-timer sr-loop-timer)
145 (setq sr-loop-timer nil))))
146
147 (defun sr-loop-enable-timer ()
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
148 "Enable the automatic shutdown timer.
149 This is done every time we receive confirmation from the
150 background interpreter that all the tasks delegated to it have
151 been completed. Once this function is executed, if no new tasks
152 are enqueued before `sr-loop-timeout' seconds, the interpreter is
153 killed."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
154 (sr-loop-disable-timer)
155 (setq sr-loop-timer (run-with-timer sr-loop-timeout nil 'sr-loop-stop)))
156
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
157 (defun sr-loop-stop (&optional interrupt)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
158 "Shut down the background Elisp interpreter and clean up after it."
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
159 (interactive "p")
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
160 (sr-loop-disable-timer)
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
161 (if sr-loop-queue
162 (if interrupt
163 (progn
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
164 (sr-loop-notify "Aborted. Some operations may remain unfinished.")
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
165 (setq sr-loop-queue nil))
166 (sr-loop-enable-timer)))
167 (unless sr-loop-queue
06e9ba1 @escherdragon Version 2!
authored
168 (delete-process sr-loop-process)
169 (setq sr-loop-process nil)))
170
171 (defun sr-loop-notify (msg)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
172 "Notify the user about an event."
ffc49a6 @escherdragon +Added customizable variable to enable/disable pop-ups
authored
173 (if (and window-system sr-loop-use-popups)
06e9ba1 @escherdragon Version 2!
authored
174 (x-popup-dialog t (list msg '("OK")) t)
175 (message (concat "[[" msg "]]"))))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
176
86a223c @escherdragon +Use lexical bindings.
authored
177 (defun sr-loop-filter (_process output)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
178 "Process filter for the background interpreter."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
179 (mapc (lambda (line)
06e9ba1 @escherdragon Version 2!
authored
180 (cond ((string-match "^\\[\\[\\*\\([^\]\*]+\\)\\*\\]\\]$" line)
181 (sr-loop-notify (match-string 1 line)))
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
182
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
183 ((and (or (string-match "^\\[\\[" line)
184 (string-match "^Sunrise Loop: " line))
185 (< 0 (length line)))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
186 (message "%s" line))
06e9ba1 @escherdragon Version 2!
authored
187
188 ((eq ?^ (string-to-char line))
189 (let ((command (substring line 1)))
190 (when (string= command (car sr-loop-queue))
191 (pop sr-loop-queue)
192 (sr-loop-enable-timer)
193 (unless sr-loop-queue
194 (sr-loop-notify "Background job finished!")))))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
195 (t nil)))
196 (split-string output "\n")))
197
198 (defun sr-loop-enqueue (form)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
199 "Delegate evaluation of FORM to the background interpreter.
200 If no such interpreter is currently running, launches a new one."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
201 (sr-loop-disable-timer)
06e9ba1 @escherdragon Version 2!
authored
202 (unless sr-loop-process
203 (sr-loop-start))
204 (let ((command (prin1-to-string form)))
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
205 (setq sr-loop-queue (append sr-loop-queue (list (md5 command))))
06e9ba1 @escherdragon Version 2!
authored
206 (process-send-string sr-loop-process command)
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
207 (process-send-string sr-loop-process "\n")))
208
209 (defun sr-loop-cmd-loop ()
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
210 "Main execution loop for the background Elisp interpreter."
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
211 (sr-ad-disable "^sr-loop-")
97fad10 @escherdragon +Bugfix: now overwrites read-char in the background interpreter to al…
authored
212 (defun read-char nil ?y) ;; Always answer "yes" to any prompt
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
213 (let ((command) (signature))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
214 (while t
215 (setq command (read))
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
216 (setq signature (md5 (prin1-to-string command)))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
217 (condition-case description
218 (progn
219 (if sr-loop-debug
06e9ba1 @escherdragon Version 2!
authored
220 (message "%s" (concat "[[Executing in background: "
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
221 (prin1-to-string command) "]]")))
222 (eval command)
5534fb4 @escherdragon +Bugfix: updated Loop and Mirror to be compatible with Sunrise 4 (cha…
authored
223 (message "[[Command successfully invoked in background]]"))
06e9ba1 @escherdragon Version 2!
authored
224 (error (message "%s" (concat "[[*ERROR IN BACKGROUND JOB: "
225 (prin1-to-string description) "*]]"))))
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
226 (message "^%s" signature))))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
227
228 (defun sr-loop-applicable-p ()
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
229 "Return non-nil if an operation is suitable for the background interpreter."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
230 (and (null (string-match "^/ftp:" dired-directory))
231 (null (string-match "^/ftp:" sr-other-directory))))
232
233 (defun sr-loop-do-copy (&optional arg)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
234 "Drop-in prefixable replacement for the `sr-do-copy' command.
235 When invoked with a prefix argument, sets a flag that is used
236 later by advice to decide whether to delegate further copy
237 operations to the background interpreter."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
238 (interactive "P")
239 (if (and arg (sr-loop-applicable-p))
240 (let ((sr-loop-scope t))
241 (sr-do-copy))
242 (sr-do-copy)))
243
5534fb4 @escherdragon +Bugfix: updated Loop and Mirror to be compatible with Sunrise 4 (cha…
authored
244 (defun sr-loop-do-clone (&optional arg)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
245 "Drop-in prefixable replacement for the `sr-do-clone' command.
246 When invoked with a prefix argument, sets a flag that is used
247 later by advice to decide whether to delegate further copy
248 operations to the background interpreter."
5534fb4 @escherdragon +Bugfix: updated Loop and Mirror to be compatible with Sunrise 4 (cha…
authored
249 (interactive "P")
250 (if (and arg (sr-loop-applicable-p))
251 (let ((sr-loop-scope t))
252 (call-interactively 'sr-do-clone))
253 (call-interactively 'sr-do-clone)))
254
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
255 (defun sr-loop-do-rename (&optional arg)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
256 "Drop-in prefixable replacement for the `sr-do-rename' command.
257 When invoked with a prefix argument, sets a flag that is used
258 later by advice to decide whether to delegate further rename
259 operations to the background interpreter."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
260 (interactive "P")
261 (if (and arg (sr-loop-applicable-p))
262 (let ((sr-loop-scope t))
263 (sr-do-rename))
264 (sr-do-rename)))
265
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
266 (defadvice sr-progress-prompt (around sr-loop-advice-sr-progress-prompt
267 activate)
268 "Display \"Sunrise Loop\" instead of \"Sunrise\" in the prompt."
269 (setq ad-return-value
270 (concat (if sr-loop-scope "Sunrise Loop: " "Sunrise: ")
271 (ad-get-arg 0)
272 "...")))
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
273
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
274 (defadvice y-or-n-p (before sr-loop-advice-y-or-n-p activate)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
275 "Modify all confirmation request messages inside a loop scope."
06e9ba1 @escherdragon Version 2!
authored
276 (when sr-loop-scope
5edbb16 @stepnem +x-loop: Fix the `y-or-n-p' advice for Emacs 24.
stepnem authored
277 (setq (ad-get-arg 0)
278 (replace-regexp-in-string
279 "\?" " in the background? (overwrites ALWAYS!)" (ad-get-arg 0)))))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
280
97fad10 @escherdragon +Bugfix: now overwrites read-char in the background interpreter to al…
authored
281 (defadvice dired-mark-read-file-name
282 (before sr-loop-advice-dired-mark-read-file-name
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
283 (prompt dir op-symbol arg files &optional default)
284 activate)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
285 "Modify all queries from Dired inside a loop scope."
97fad10 @escherdragon +Bugfix: now overwrites read-char in the background interpreter to al…
authored
286 (if sr-loop-scope
287 (setq prompt (replace-regexp-in-string
288 "^\\([^ ]+\\) ?\\(.*\\)"
289 "\\1 (in background - overwrites ALWAYS!) \\2" prompt))))
290
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
291 (defadvice dired-create-files
292 (around sr-loop-advice-dired-create-files
293 (file-creator operation fn-list name-constructor
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
294 &optional marker-char)
295 activate)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
296 "Delegate to the background interpreter all copy and rename operations
297 triggered by `dired-do-copy' inside a loop scope."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
298 (if sr-loop-scope
299 (with-no-warnings
300 (sr-loop-enqueue
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
301 `(let ((target ,target)) ; cf. `dired-do-create-files'
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
302 (dired-create-files (function ,file-creator)
303 ,operation
304 (quote ,fn-list)
305 ,name-constructor nil))))
306 ad-do-it))
307
5534fb4 @escherdragon +Bugfix: updated Loop and Mirror to be compatible with Sunrise 4 (cha…
authored
308 (defadvice sr-clone-files
309 (around sr-loop-advice-sr-clone-files
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
310 (file-path-list target-dir clone-op progress &optional do-overwrite)
311 activate)
32d19ec @stepnem =Documentation string and typo fixes.
stepnem authored
312 "Delegate to the background interpreter all copy operations
313 triggered by `sr-do-copy' inside a loop scope."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
314 (if sr-loop-scope
315 (sr-loop-enqueue
5534fb4 @escherdragon +Bugfix: updated Loop and Mirror to be compatible with Sunrise 4 (cha…
authored
316 `(sr-clone-files
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
317 (quote ,file-path-list) ,target-dir #',clone-op ',progress 'ALWAYS))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
318 ad-do-it))
319
320 (defadvice sr-move-files
321 (around sr-loop-advice-sr-move-files
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
322 (file-path-list target-dir progress &optional do-overwrite)
323 activate)
324 "Delegate to the background interpreter all rename operations
325 triggered by `sr-do-rename' inside a loop scope."
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
326 (if sr-loop-scope
327 (sr-loop-enqueue
1768439 @escherdragon +Added progress feedback for synchronous copy, clone, rename and comp…
authored
328 `(sr-move-files (quote ,file-path-list) ,target-dir ',progress 'ALWAYS))
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
329 ad-do-it))
330
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
331 (define-key sr-mode-map "C" 'sr-loop-do-copy)
332 (define-key sr-mode-map "K" 'sr-loop-do-clone)
333 (define-key sr-mode-map "R" 'sr-loop-do-rename)
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
334
af84e02 +Added stepnem's commits b75bb2 cdb06d and b6d97b, which cannot be ap…
escherdragon authored
335 (defun sunrise-x-loop-unload-function ()
f5037b8 @stepnem +Sanitise the x-loop extension for clean unloading.
stepnem authored
336 (sr-ad-disable "^sr-loop-")
337 (define-key sr-mode-map "C" 'sr-do-copy)
338 (define-key sr-mode-map "K" 'sr-do-clone)
339 (define-key sr-mode-map "R" 'sr-do-rename))
af84e02 +Added stepnem's commits b75bb2 cdb06d and b6d97b, which cannot be ap…
escherdragon authored
340
e23dea1 @escherdragon +First commit of sunrise-x-loop.el
authored
341 (provide 'sunrise-x-loop)
3fc1010 @escherdragon +Added standard footer (";;; xxx.el ends here.").
authored
342
80bfccf @escherdragon +New function sr-extend-with for explicit registration of extensions.
authored
343 ;;;###autoload (eval-after-load 'sunrise-commander '(sr-extend-with 'sunrise-x-loop))
62c774c @escherdragon +Refactored function sr-dired to implement the dired interface
authored
344
202dba6 @stepnem =Unperiodify first and last lines.
stepnem authored
345 ;;; sunrise-x-loop.el ends here
Something went wrong with that request. Please try again.