[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gnus/gnus-util.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gnus/gnus-util.el [lexbind] |
Date: |
Mon, 25 Oct 2004 00:47:22 -0400 |
Index: emacs/lisp/gnus/gnus-util.el
diff -c emacs/lisp/gnus/gnus-util.el:1.16.4.4
emacs/lisp/gnus/gnus-util.el:1.16.4.5
*** emacs/lisp/gnus/gnus-util.el:1.16.4.4 Wed Oct 6 05:21:52 2004
--- emacs/lisp/gnus/gnus-util.el Mon Oct 25 04:22:24 2004
***************
*** 38,44 ****
(eval-when-compile
(require 'cl)
;; Fixme: this should be a gnus variable, not nnmail-.
! (defvar nnmail-pathname-coding-system))
(require 'time-date)
(require 'netrc)
--- 38,48 ----
(eval-when-compile
(require 'cl)
;; Fixme: this should be a gnus variable, not nnmail-.
! (defvar nnmail-pathname-coding-system)
!
! ;; Inappropriate references to other parts of Gnus.
! (defvar gnus-emphasize-whitespace-regexp)
! )
(require 'time-date)
(require 'netrc)
***************
*** 1186,1192 ****
"Delete by side effect any elements of LIST whose car is `equal' to KEY.
The modified LIST is returned. If the first member
of LIST has a car that is `equal' to KEY, there is no way to remove it
! by side effect; therefore, write `(setq foo (remassoc key foo))' to be
sure of changing the value of `foo'."
(when alist
(if (equal key (caar alist))
--- 1190,1196 ----
"Delete by side effect any elements of LIST whose car is `equal' to KEY.
The modified LIST is returned. If the first member
of LIST has a car that is `equal' to KEY, there is no way to remove it
! by side effect; therefore, write `(setq foo (gnus-remassoc key foo))' to be
sure of changing the value of `foo'."
(when alist
(if (equal key (caar alist))
***************
*** 1512,1517 ****
--- 1516,1543 ----
"")))
(t emacs-version))))
+ (defun gnus-rename-file (old-path new-path &optional trim)
+ "Rename OLD-PATH as NEW-PATH. If TRIM, recursively delete
+ empty directories from OLD-PATH."
+ (when (file-exists-p old-path)
+ (let* ((old-dir (file-name-directory old-path))
+ (old-name (file-name-nondirectory old-path))
+ (new-dir (file-name-directory new-path))
+ (new-name (file-name-nondirectory new-path))
+ temp)
+ (gnus-make-directory new-dir)
+ (rename-file old-path new-path t)
+ (when trim
+ (while (progn (setq temp (directory-files old-dir))
+ (while (member (car temp) '("." ".."))
+ (setq temp (cdr temp)))
+ (= (length temp) 0))
+ (delete-directory old-dir)
+ (setq old-dir (file-name-as-directory
+ (file-truename
+ (concat old-dir "..")))))))))
+
+
(provide 'gnus-util)
;;; arch-tag: f94991af-d32b-4c97-8c26-ca12a934de49