aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2007-10-31 10:24:20 +0000
committerJuanma Barranquero2007-10-31 10:24:20 +0000
commit32f389a47ea8583027f030ce77b1dd7d741f77d4 (patch)
tree49abf3bd846e6fe6871b96c97c1e9ac983e94b9c
parent21ae32aaa490ab18321ce24282fb804b33a07f8f (diff)
downloademacs-32f389a47ea8583027f030ce77b1dd7d741f77d4.tar.gz
emacs-32f389a47ea8583027f030ce77b1dd7d741f77d4.zip
(shadow-join): Remove.
(shadow-shadows): Use `mapconcat' instead of `shadow-join'. (shadow-initialize): Use `write-file-functions', not `write-file-hooks'. (shadowfile-unload-hook): Remove function and variable. (shadowfile-unload-function): New-style unload function, adapted from `shadowfile-unload-hook'.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/shadowfile.el36
2 files changed, 25 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ff36e73b6ad..a8e111cb2ed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12007-10-31 Juanma Barranquero <lekktu@gmail.com>
2
3 * shadowfile.el (shadow-join): Remove.
4 (shadow-shadows): Use `mapconcat' instead of `shadow-join'.
5 (shadow-initialize): Use `write-file-functions', not `write-file-hooks'.
6 (shadowfile-unload-hook): Remove function and variable.
7 (shadowfile-unload-function): New-style unload function, adapted
8 from `shadowfile-unload-hook'.
9
12007-10-31 Dan Nicolaescu <dann@ics.uci.edu> 102007-10-31 Dan Nicolaescu <dann@ics.uci.edu>
2 11
3 * progmodes/mixal-mode.el (mixal-run, mixal-debug): Call mixvm 12 * progmodes/mixal-mode.el (mixal-run, mixal-debug): Call mixvm
@@ -19,8 +28,8 @@
19 Wrap with-no-warnings around uses of next-line and previous-line. 28 Wrap with-no-warnings around uses of next-line and previous-line.
20 29
21 * ediff.el (run-ediff-from-cvs-buffer): 30 * ediff.el (run-ediff-from-cvs-buffer):
22 * ediff-vers.el (cvs-run-ediff-on-file-descriptor): Remove 31 * ediff-vers.el (cvs-run-ediff-on-file-descriptor):
23 function not used by pcl-cvs anymore. 32 Remove function not used by pcl-cvs anymore.
24 (noninteractive, generic-sc-get-latest-rev) 33 (noninteractive, generic-sc-get-latest-rev)
25 (ediff-generic-sc-internal, ediff-generic-sc-merge-internal): 34 (ediff-generic-sc-internal, ediff-generic-sc-merge-internal):
26 Delete support for long obsolete generic-sc.el. 35 Delete support for long obsolete generic-sc.el.
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el
index d1de8be3910..ca06ace2214 100644
--- a/lisp/shadowfile.el
+++ b/lisp/shadowfile.el
@@ -28,7 +28,7 @@
28;; This package helps you to keep identical copies of files in more than one 28;; This package helps you to keep identical copies of files in more than one
29;; place - possibly on different machines. When you save a file, it checks 29;; place - possibly on different machines. When you save a file, it checks
30;; whether it is on the list of files with "shadows", and if so, it tries to 30;; whether it is on the list of files with "shadows", and if so, it tries to
31;; copy it when you exit emacs (or use the shadow-copy-files command). 31;; copy it when you exit Emacs (or use the shadow-copy-files command).
32 32
33;; Installation & Use: 33;; Installation & Use:
34 34
@@ -38,8 +38,8 @@
38;; them). After doing this once, everything should be automatic. 38;; them). After doing this once, everything should be automatic.
39 39
40;; The lists of clusters and shadows are saved in a file called .shadows, 40;; The lists of clusters and shadows are saved in a file called .shadows,
41;; so that they can be remembered from one emacs session to another, even 41;; so that they can be remembered from one Emacs session to another, even
42;; (as much as possible) if the emacs session terminates abnormally. The 42;; (as much as possible) if the Emacs session terminates abnormally. The
43;; files needing to be copied are stored in .shadow_todo; if a file cannot 43;; files needing to be copied are stored in .shadow_todo; if a file cannot
44;; be copied for any reason, it will stay on the list to be tried again 44;; be copied for any reason, it will stay on the list to be tried again
45;; next time. The .shadows file should itself have shadows on all your 45;; next time. The .shadows file should itself have shadows on all your
@@ -47,7 +47,7 @@
47;; .shadow_todo is local information and should have no shadows. 47;; .shadow_todo is local information and should have no shadows.
48 48
49;; If you do not want to copy a particular file, you can answer "no" and 49;; If you do not want to copy a particular file, you can answer "no" and
50;; be asked again next time you hit C-x 4 s or exit emacs. If you do not 50;; be asked again next time you hit C-x 4 s or exit Emacs. If you do not
51;; want to be asked again, use shadow-cancel, and you will not be asked 51;; want to be asked again, use shadow-cancel, and you will not be asked
52;; until you change the file and save it again. If you do not want to 52;; until you change the file and save it again. If you do not want to
53;; shadow that file ever again, you can edit it out of the .shadows 53;; shadow that file ever again, you can edit it out of the .shadows
@@ -192,12 +192,6 @@ Nondestructive; actually returns a copy of the list with the elements removed."
192 (cons (car list) (shadow-remove-if func (cdr list)))) 192 (cons (car list) (shadow-remove-if func (cdr list))))
193 nil)) 193 nil))
194 194
195(defun shadow-join (strings sep)
196 "Concatenate elements of the list of STRINGS with SEP between each."
197 (cond ((null strings) "")
198 ((null (cdr strings)) (car strings))
199 ((concat (car strings) " " (shadow-join (cdr strings) sep)))))
200
201(defun shadow-regexp-superquote (string) 195(defun shadow-regexp-superquote (string)
202 "Like `regexp-quote', but includes the ^ and $. 196 "Like `regexp-quote', but includes the ^ and $.
203This makes sure regexp matches nothing but STRING." 197This makes sure regexp matches nothing but STRING."
@@ -503,9 +497,7 @@ Each site can be either a hostname or the name of a cluster \(see
503 ;; Mostly for debugging. 497 ;; Mostly for debugging.
504 "Interactive function to display shadows of a buffer." 498 "Interactive function to display shadows of a buffer."
505 (interactive) 499 (interactive)
506 (let ((msg (shadow-join (mapcar (function cdr) 500 (let ((msg (mapconcat #'cdr (shadow-shadows-of (buffer-file-name)) " ")))
507 (shadow-shadows-of (buffer-file-name)))
508 " ")))
509 (message "%s" 501 (message "%s"
510 (if (zerop (length msg)) 502 (if (zerop (length msg))
511 "No shadows." 503 "No shadows."
@@ -643,7 +635,7 @@ Consider them as regular expressions if third arg REGEXP is true."
643 "Use \\[shadow-copy-files] to update shadows.")) 635 "Use \\[shadow-copy-files] to update shadows."))
644 (sit-for 1)) 636 (sit-for 1))
645 (shadow-write-todo-file))) 637 (shadow-write-todo-file)))
646 nil) ; Return nil for write-file-hooks 638 nil) ; Return nil for write-file-functions
647 639
648(defun shadow-remove-from-todo (pair) 640(defun shadow-remove-from-todo (pair)
649 "Remove PAIR from `shadow-files-to-copy'. 641 "Remove PAIR from `shadow-files-to-copy'.
@@ -830,16 +822,16 @@ look for files that have been changed and need to be copied to other systems."
830 (defalias 'shadow-orig-save-buffers-kill-emacs 822 (defalias 'shadow-orig-save-buffers-kill-emacs
831 (symbol-function 'save-buffers-kill-emacs)) 823 (symbol-function 'save-buffers-kill-emacs))
832 (defalias 'save-buffers-kill-emacs 'shadow-save-buffers-kill-emacs)) 824 (defalias 'save-buffers-kill-emacs 'shadow-save-buffers-kill-emacs))
833 (add-hook 'write-file-hooks 'shadow-add-to-todo) 825 (add-hook 'write-file-functions 'shadow-add-to-todo)
834 (define-key ctl-x-4-map "s" 'shadow-copy-files))) 826 (define-key ctl-x-4-map "s" 'shadow-copy-files)))
835 827
836(defun shadowfile-unload-hook () 828(defun shadowfile-unload-function ()
837 (if (fboundp 'shadow-orig-save-buffers-kill-emacs) 829 (substitute-key-definition 'shadow-copy-files nil ctl-x-4-map)
838 (fset 'save-buffers-kill-emacs 830 (when (fboundp 'shadow-orig-save-buffers-kill-emacs)
839 (symbol-function 'shadow-orig-save-buffers-kill-emacs))) 831 (fset 'save-buffers-kill-emacs
840 (remove-hook 'write-file-hooks 'shadow-add-to-todo)) 832 (symbol-function 'shadow-orig-save-buffers-kill-emacs)))
841 833 ;; continue standard unloading
842(add-hook 'shadowfile-unload-hook 'shadowfile-unload-hook) 834 nil)
843 835
844(provide 'shadowfile) 836(provide 'shadowfile)
845 837