[gnus git] branch master updated: m0-1-32-g15ceddb =1= Redefine `delete-directory' on Emacs 22 and XEmacs

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  15ceddb656d3650b6626205b58629b68f67a86c3 (commit)
      from  ba7652b1c0b3dfee4979db1b94f6ce945ba43151 (commit)


- Log -----------------------------------------------------------------
commit 15ceddb656d3650b6626205b58629b68f67a86c3
Author: Lars Ingebrigtsen <[email protected]>
Date:   Wed Feb 1 20:35:34 2012 +0100

    Redefine `delete-directory' on Emacs 22 and XEmacs
    
    * gnus-compat.el: Redefine `delete-directory' to provide recursive
    deletion unless already defined.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f005cc3..fbb9f7d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
 2012-02-01  Lars Ingebrigtsen  <[email protected]>
 
+	* gnus-compat.el: Redefine `delete-directory' to provide recursive
+	deletion unless already defined.
+
 	* gnus.el (gnus-compat): Require it.
 
 	* gnus-compat.el: New file.
diff --git a/lisp/gnus-compat.el b/lisp/gnus-compat.el
index db2c452..523fc2f 100644
--- a/lisp/gnus-compat.el
+++ b/lisp/gnus-compat.el
@@ -28,11 +28,26 @@
 ;; functions "missing" in other Emacs instances, and redefine other
 ;; functions to work like the Emacs trunk versions.
 
-(provide 'gnus-compat)
+(eval-when-compile (require 'cl))
 
 (when (and (not (fboundp 'help-function-arglist))
 	   (fboundp 'function-arglist))
   (defun help-function-arglist (def &optional preserve-names)
     (cdr (car (read-from-string (downcase (function-arglist def)))))))
 
+(when (= (length (help-function-arglist 'delete-directory)) 1)
+  (defvar gnus-compat-original-delete-directory 
+    (symbol-function 'delete-directory))
+  (defun delete-directory (directory &optional recursive)
+    (if (not recursive)
+	(funcall gnus-compat-original-delete-directory directory)
+      (dolist (file (directory-files directory t))
+	(unless (member (file-name-nondirectory file) '("." ".."))
+	  (if (file-directory-p file)
+	      (delete-directory file t)
+	    (delete-file file))))
+      (delete-directory directory))))
+
+(provide 'gnus-compat)
+
 ;; gnus-compat.el ends here

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog      |    3 +++
 lisp/gnus-compat.el |   17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.