38 |
(eval-when-compile |
(eval-when-compile |
39 |
(require 'cl) |
(require 'cl) |
40 |
;; Fixme: this should be a gnus variable, not nnmail-. |
;; Fixme: this should be a gnus variable, not nnmail-. |
41 |
(defvar nnmail-pathname-coding-system)) |
(defvar nnmail-pathname-coding-system) |
42 |
|
|
43 |
|
;; Inappropriate references to other parts of Gnus. |
44 |
|
(defvar gnus-emphasize-whitespace-regexp) |
45 |
|
) |
46 |
(require 'time-date) |
(require 'time-date) |
47 |
(require 'netrc) |
(require 'netrc) |
48 |
|
|
1190 |
"Delete by side effect any elements of LIST whose car is `equal' to KEY. |
"Delete by side effect any elements of LIST whose car is `equal' to KEY. |
1191 |
The modified LIST is returned. If the first member |
The modified LIST is returned. If the first member |
1192 |
of LIST has a car that is `equal' to KEY, there is no way to remove it |
of LIST has a car that is `equal' to KEY, there is no way to remove it |
1193 |
by side effect; therefore, write `(setq foo (remassoc key foo))' to be |
by side effect; therefore, write `(setq foo (gnus-remassoc key foo))' to be |
1194 |
sure of changing the value of `foo'." |
sure of changing the value of `foo'." |
1195 |
(when alist |
(when alist |
1196 |
(if (equal key (caar alist)) |
(if (equal key (caar alist)) |
1516 |
""))) |
""))) |
1517 |
(t emacs-version)))) |
(t emacs-version)))) |
1518 |
|
|
1519 |
|
(defun gnus-rename-file (old-path new-path &optional trim) |
1520 |
|
"Rename OLD-PATH as NEW-PATH. If TRIM, recursively delete |
1521 |
|
empty directories from OLD-PATH." |
1522 |
|
(when (file-exists-p old-path) |
1523 |
|
(let* ((old-dir (file-name-directory old-path)) |
1524 |
|
(old-name (file-name-nondirectory old-path)) |
1525 |
|
(new-dir (file-name-directory new-path)) |
1526 |
|
(new-name (file-name-nondirectory new-path)) |
1527 |
|
temp) |
1528 |
|
(gnus-make-directory new-dir) |
1529 |
|
(rename-file old-path new-path t) |
1530 |
|
(when trim |
1531 |
|
(while (progn (setq temp (directory-files old-dir)) |
1532 |
|
(while (member (car temp) '("." "..")) |
1533 |
|
(setq temp (cdr temp))) |
1534 |
|
(= (length temp) 0)) |
1535 |
|
(delete-directory old-dir) |
1536 |
|
(setq old-dir (file-name-as-directory |
1537 |
|
(file-truename |
1538 |
|
(concat old-dir ".."))))))))) |
1539 |
|
|
1540 |
|
|
1541 |
(provide 'gnus-util) |
(provide 'gnus-util) |
1542 |
|
|
1543 |
;;; arch-tag: f94991af-d32b-4c97-8c26-ca12a934de49 |
;;; arch-tag: f94991af-d32b-4c97-8c26-ca12a934de49 |