From e87c4c6e9a3844c7e9490b617e5c6b33036e9eda Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 22 Jul 2008 17:16:52 +0000 Subject: [PATCH] (vc-arch-trim-make-sentinel): Use a closure. (vc-arch-trim-one-revlib): Delete temp directories as well. --- lisp/ChangeLog | 14 ++++++++------ lisp/vc-arch.el | 14 +++++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bfa524d6f06..6819b3801db 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,12 +1,15 @@ +2008-07-22 Stefan Monnier + + * vc-arch.el (vc-arch-trim-make-sentinel): Use a closure. + (vc-arch-trim-one-revlib): Delete temp directories as well. + 2008-07-22 Stephen Eglen - * iswitchb.el (iswitchb-delim): New variable, suggested by Ted - Roden. + * iswitchb.el (iswitchb-delim): New variable, suggested by Ted Roden. 2008-07-22 Sven Joachim (tiny change) - * vc-dir.el (vc-dir-recompute-file-state): Fix mismatched - paenthesis. + * vc-dir.el (vc-dir-recompute-file-state): Fix mismatched paenthesis. 2008-07-22 Miles Bader @@ -29,8 +32,7 @@ * menu-bar.el (menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap" command. - * simple.el (visual-line-mode): Disable - truncate-partial-width-windows. + * simple.el (visual-line-mode): Disable truncate-partial-width-windows. 2008-07-21 Dan Nicolaescu diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el index 5aeeaf5e864..cc8c8ae3c1e 100644 --- a/lisp/vc-arch.el +++ b/lisp/vc-arch.el @@ -488,16 +488,20 @@ Return non-nil if FILE is unchanged." (defun vc-arch-trim-make-sentinel (revs) (if (null revs) (lambda (proc msg) (message "VC-Arch trimming ... done")) - `(lambda (proc msg) - (message "VC-Arch trimming %s..." ',(file-name-nondirectory (car revs))) - (rename-file ,(car revs) ,(concat (car revs) "*rm*")) + (lexical-let ((revs revs)) + (lambda (proc msg) + (message "VC-Arch trimming %s..." (file-name-nondirectory (car revs))) + (rename-file (car revs) (concat (car revs) "*rm*")) (setq proc (start-process "vc-arch-trim" nil - "rm" "-rf" ',(concat (car revs) "*rm*"))) - (set-process-sentinel proc (vc-arch-trim-make-sentinel ',(cdr revs)))))) + "rm" "-rf" (concat (car revs) "*rm*"))) + (set-process-sentinel proc (vc-arch-trim-make-sentinel (cdr revs))))))) (defun vc-arch-trim-one-revlib (dir) "Delete half of the revisions in the revision library." (interactive "Ddirectory: ") + (let ((garbage (directory-files dir 'full "\\`,," 'nosort))) + (when garbage + (funcall (vc-arch-trim-make-sentinel garbage) nil nil))) (let ((revs (sort (delq nil (mapcar -- 2.39.2