(elmo-folder-move-messages): Check `elmo-folder-writable-p'.
* elmo-archive.el (elmo-folder-writable-p): Defined.
* elmo-cache.el (elmo-folder-writable-p): Ditto.
* elmo-filter.el (elmo-folder-writable-p): Ditto.
* elmo-imap4.el (elmo-folder-writable-p): Ditto.
* elmo-localdir.el (elmo-folder-writable-p): Ditto.
* elmo-maildir.el (elmo-folder-writable-p): Ditto.
* elmo-mark.el (elmo-folder-writable-p): Ditto.
* elmo-pipe.el (elmo-folder-writable-p): Ditto.
* elmo-nntp.el (elmo-folder-writable-p): Eliminated.
+2001-09-20 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * elmo.el (elmo-folder-writable-p): Changed default value to nil.
+ (elmo-folder-move-messages): Check `elmo-folder-writable-p'.
+
+ * elmo-archive.el (elmo-folder-writable-p): Defined.
+
+ * elmo-cache.el (elmo-folder-writable-p): Ditto.
+
+ * elmo-filter.el (elmo-folder-writable-p): Ditto.
+
+ * elmo-imap4.el (elmo-folder-writable-p): Ditto.
+
+ * elmo-localdir.el (elmo-folder-writable-p): Ditto.
+
+ * elmo-maildir.el (elmo-folder-writable-p): Ditto.
+
+ * elmo-mark.el (elmo-folder-writable-p): Ditto.
+
+ * elmo-pipe.el (elmo-folder-writable-p): Ditto.
+
+ * elmo-nntp.el (elmo-folder-writable-p): Eliminated.
+
2001-09-20 Yuuichi Teranishi <teranisi@gohome.org>
* elmo-util.el (elmo-address-quote-specials): New function;
;;
;;; Commentary:
-;;
+;;
;; TODO:
;; Info-Zip ÀìÍÑ¥¨¡¼¥¸¥§¥ó¥È¤òÍѤ¤¤¿ÆüËܸ측º÷¡ÊOS/2 ÀìÍÑ¡Ë¡£
;;; Code:
-;;
+;;
(require 'elmo-msgdb)
(require 'emu)
TYPE specifies the archiver's symbol."
(let* ((type (elmo-archive-folder-archive-type-internal folder))
(prefix (elmo-archive-folder-archive-prefix-internal folder))
- (file (elmo-archive-get-archive-name folder))
+ (file (elmo-archive-get-archive-name folder))
(method (elmo-archive-get-method type 'ls))
(args (list file))
(file-regexp (format (elmo-archive-get-regexp type)
(defun elmo-archive-get-archive-name (folder)
(let ((dir (elmo-archive-get-archive-directory folder))
- (suffix (elmo-archive-get-suffix
+ (suffix (elmo-archive-get-suffix
(elmo-archive-folder-archive-type-internal
folder)))
filename dbdir)
(luna-define-method elmo-folder-creatable-p ((folder elmo-archive-folder))
t)
+(luna-define-method elmo-folder-writable-p ((folder elmo-archive-folder))
+ t)
+
(luna-define-method elmo-folder-create ((folder elmo-archive-folder))
(let* ((dir (directory-file-name ; remove tail slash.
(elmo-archive-get-archive-directory folder)))
- (type (elmo-archive-folder-archive-type-internal folder))
- (arc (elmo-archive-get-archive-name folder)))
+ (type (elmo-archive-folder-archive-type-internal folder))
+ (arc (elmo-archive-get-archive-name folder)))
(if elmo-archive-treat-file
(setq dir (directory-file-name (file-name-directory dir))))
(cond ((and (file-exists-p dir)
(not (file-directory-p dir)))
- ;; file exists
- (error "Create folder failed; File \"%s\" exists" dir))
- ((file-directory-p dir)
- (if (file-exists-p arc)
- t ; return value
+ ;; file exists
+ (error "Create folder failed; File \"%s\" exists" dir))
+ ((file-directory-p dir)
+ (if (file-exists-p arc)
+ t ; return value
(elmo-archive-create-file arc type folder)))
- (t
+ (t
(elmo-make-directory dir)
(elmo-archive-create-file arc type folder)
t))))
(save-excursion
(let* ((tmp-dir (directory-file-name
(elmo-folder-msgdb-path folder)))
- (dummy elmo-archive-dummy-file)
- (method (or (elmo-archive-get-method type 'create)
+ (dummy elmo-archive-dummy-file)
+ (method (or (elmo-archive-get-method type 'create)
(elmo-archive-get-method type 'mv)))
(args (list archive dummy)))
(when (null method)
(prefix (if (string=
(elmo-archive-folder-archive-prefix-internal folder)
"")
- ""
+ ""
(concat ";"
(elmo-archive-folder-archive-prefix-internal
folder))))
(elmo-folder-message-file-p src-folder)
(elmo-folder-message-file-number-p src-folder))
;; same-number(localdir, localnews) -> archive
- (elmo-archive-append-files folder
+ (elmo-archive-append-files folder
(elmo-folder-message-file-directory src-folder)
numbers)
numbers)
(elmo-make-directory (file-name-directory prefix)))
(rename-file
temp-dir
- (setq new-dir
+ (setq new-dir
(expand-file-name
prefix
;; parent of temp-dir..(works in windows?)
(or (elmo-archive-get-method type 'ext-pipe)
(elmo-archive-get-method type 'ext))))
-(luna-define-method elmo-folder-message-make-temp-files
+(luna-define-method elmo-folder-message-make-temp-files
((folder elmo-archive-folder) numbers
&optional start-number)
(elmo-archive-folder-message-make-temp-files folder numbers start-number))
start-number)
(let* ((tmp-dir-src (elmo-folder-make-temp-dir folder))
(tmp-dir-dst (elmo-folder-make-temp-dir folder))
- (arc (elmo-archive-get-archive-name folder))
+ (arc (elmo-archive-get-archive-name folder))
(type (elmo-archive-folder-archive-type-internal folder))
(prefix (elmo-archive-folder-archive-prefix-internal folder))
(p-method (elmo-archive-get-method type 'ext-pipe))
(int-to-string x))) numbers))
number)
;; Expand files in the tmp-dir-src.
- (elmo-bind-directory
+ (elmo-bind-directory
tmp-dir-src
(cond
((functionp n-method)
(elmo-delete-directory tmp-dir-src)
;; tmp-dir-dst is the return directory.
tmp-dir-dst))
-
+
(defun elmo-archive-append-files (folder dir &optional files)
(let* ((dst-type (elmo-archive-folder-archive-type-internal folder))
(arc (elmo-archive-get-archive-name folder))
(elmo-archive-folder-archive-type-internal folder)
'cat-headers))
(elmo-archive-msgdb-create-as-numlist-subr2
- folder numbers new-mark already-mark seen-mark important-mark
+ folder numbers new-mark already-mark seen-mark important-mark
seen-list)
(elmo-archive-msgdb-create-as-numlist-subr1
- folder numbers new-mark already-mark seen-mark important-mark
+ folder numbers new-mark already-mark seen-mark important-mark
seen-list)))))
-(defun elmo-archive-msgdb-create-as-numlist-subr1 (folder
+(defun elmo-archive-msgdb-create-as-numlist-subr1 (folder
numlist new-mark
already-mark seen-mark
important-mark
(goto-char (point-min))
(setq rest msgs)
(while (and rest (re-search-forward delim nil t)
- (not (eobp)))
+ (not (eobp)))
(setq number (car rest))
(setq sp (1+ (point)))
(setq ep (prog2 (re-search-forward delim)
(1+ (- (point) (length delim)))))
(if (>= sp ep) ; no article!
() ; nop
- (save-excursion
- (narrow-to-region sp ep)
- (setq entity (elmo-archive-msgdb-create-entity-subr number))
+ (save-excursion
+ (narrow-to-region sp ep)
+ (setq entity (elmo-archive-msgdb-create-entity-subr number))
(setq overview
(elmo-msgdb-append-element
overview entity))
mark-alist
(elmo-msgdb-overview-entity-get-number entity)
gmark)))
- (setq ret-val (append ret-val (list overview number-alist mark-alist)))
+ (setq ret-val (append ret-val (list overview number-alist mark-alist)))
(widen)))
(forward-line 1)
(setq rest (cdr rest)))
number-list ret-val)
(setq number-list msgs)
(while msgs
- (if (elmo-archive-field-condition-match
+ (if (elmo-archive-field-condition-match
folder (car msgs) number-list
condition
(elmo-archive-folder-archive-prefix-internal folder))
(luna-define-method elmo-folder-creatable-p ((folder elmo-cache-folder))
nil)
+(luna-define-method elmo-folder-writable-p ((folder elmo-cache-folder))
+ t)
+
(luna-define-method elmo-folder-exists-p ((folder elmo-cache-folder))
t)
(luna-define-method elmo-folder-creatable-p ((folder elmo-filter-folder))
(elmo-folder-creatable-p (elmo-filter-folder-target-internal folder)))
+(luna-define-method elmo-folder-writable-p ((folder elmo-filter-folder))
+ (elmo-folder-writable-p (elmo-filter-folder-target-internal folder)))
+
(luna-define-method elmo-folder-create ((folder elmo-filter-folder))
(elmo-folder-create (elmo-filter-folder-target-internal folder)))
(setq append-serv (concat ":" (elmo-net-folder-user-internal folder))))
(unless (eq (elmo-net-folder-auth-internal folder)
(or elmo-imap4-default-authenticate-type 'clear))
- (setq append-serv
+ (setq append-serv
(concat append-serv "/"
(symbol-name (elmo-net-folder-auth-internal folder)))))
(unless (string= (elmo-net-folder-server-internal folder)
elmo-imap4-default-server)
- (setq append-serv (concat append-serv "@"
+ (setq append-serv (concat append-serv "@"
(elmo-net-folder-server-internal folder))))
(unless (eq (elmo-net-folder-port-internal folder) elmo-imap4-default-port)
(setq append-serv (concat append-serv ":"
(if one-level
(let (folder folders ret)
(while (setq folders (car result))
- (if (prog1
+ (if (prog1
(string-match
(concat "^\\(" root "[^" delim "]" "+\\)" delim)
folders)
(setq folder (match-string 1 folders)))
(progn
- (setq ret
- (append ret
- (list
+ (setq ret
+ (append ret
+ (list
(list
- (concat
+ (concat
prefix
(elmo-imap4-decode-folder-string folder)
(and append-serv
(eval append-serv)))))))
(setq result
- (delq
+ (delq
nil
(mapcar '(lambda (fld)
(unless
fld))
result))))
(setq ret (append
- ret
- (list
+ ret
+ (list
(concat prefix
(elmo-imap4-decode-folder-string folders)
(and append-serv
(elmo-imap4-folder-mailbox-internal folder)
'force 'no-error))))
+(luna-define-method elmo-folder-writable-p ((folder elmo-imap4-folder))
+ t)
+
(luna-define-method elmo-folder-delete ((folder elmo-imap4-folder))
(let ((session (elmo-imap4-get-session folder))
msgs)
(elmo-imap4-search-internal
folder session (nth 2 condition) from-msgs)))
result (sort result '<))))))
-
+
(luna-define-method elmo-folder-search ((folder elmo-imap4-folder)
condition &optional numbers)
(save-excursion
(not (elmo-imap4-session-read-only-internal
(elmo-imap4-get-session folder)))
elmo-enable-disconnected-operation)) ; offline refile.
-
+
(luna-define-method elmo-folder-check-plugged ((folder elmo-imap4-folder))
(let ((session (elmo-imap4-get-session folder 'if-exists)))
(when session
(elmo-imap4-session-select-mailbox
session
(elmo-imap4-folder-mailbox-internal folder)
- 'force)
+ 'force)
(elmo-imap4-session-check session))))))
(defsubst elmo-imap4-folder-diff-plugged (folder)
(elmo-imap4-session-set-current-mailbox-internal
session mailbox)
(and session
- (elmo-imap4-session-set-current-mailbox-internal
+ (elmo-imap4-session-set-current-mailbox-internal
session nil))))
(error
(if response
(luna-define-method elmo-message-fetch-plugged ((folder elmo-imap4-folder)
number strategy
- &optional section
+ &optional section
outbuf unseen)
(elmo-imap4-message-fetch folder number strategy section outbuf unseen))
(setq elmo-imap4-fetch-callback nil)
(setq elmo-imap4-fetch-callback-data nil))
(with-temp-buffer
- (insert
+ (insert
(elmo-imap4-response-bodydetail-text
(elmo-imap4-response-value
(elmo-imap4-send-command-wait session
(std11-field-body (symbol-name field)))))
-
+
(require 'product)
(product-provide (provide 'elmo-imap4) (require 'elmo-version))
;;
;;; Commentary:
-;;
+;;
;;; Code:
-;;
+;;
(eval-when-compile (require 'cl))
(require 'elmo-msgdb)
(luna-define-method elmo-folder-creatable-p ((folder elmo-localdir-folder))
t)
+(luna-define-method elmo-folder-writable-p ((folder elmo-localdir-folder))
+ t)
+
(luna-define-method elmo-folder-create ((folder elmo-localdir-folder))
(let ((dir (elmo-localdir-folder-directory-internal folder)))
(if (file-directory-p dir)
(luna-define-method elmo-folder-creatable-p ((folder elmo-maildir-folder))
t)
+(luna-define-method elmo-folder-writable-p ((folder elmo-maildir-folder))
+ t)
+
(luna-define-method elmo-folder-create ((folder elmo-maildir-folder))
(let ((basedir (elmo-maildir-folder-directory-internal folder)))
(condition-case nil
(expand-file-name "internal"
elmo-msgdb-dir)))
-(luna-define-method elmo-map-folder-list-message-locations
+(luna-define-method elmo-map-folder-list-message-locations
((folder elmo-mark-folder))
(elmo-mark-folder-list-message-locations folder))
(let (result)
(dolist (pair (or elmo-msgdb-global-mark-alist
(setq elmo-msgdb-global-mark-alist
- (elmo-object-load
+ (elmo-object-load
(expand-file-name
elmo-msgdb-global-mark-filename
elmo-msgdb-dir)))))
(when (file-writable-p path)
(write-region-as-binary (point-min) (point-max)
path nil 'no-msg)))
- (elmo-msgdb-global-mark-set msgid
+ (elmo-msgdb-global-mark-set msgid
(elmo-mark-folder-mark-internal folder))))
(luna-define-method elmo-map-folder-delete-messages ((folder elmo-mark-folder)
(luna-define-method elmo-folder-exists-p ((folder elmo-mark-folder))
t)
+(luna-define-method elmo-folder-writable-p ((folder elmo-mark-folder))
+ t)
+
(luna-define-method elmo-folder-search ((folder elmo-mark-folder)
condition &optional from-msgs)
(let* ((msgs (or from-msgs (elmo-folder-list-messages folder)))
(luna-define-method elmo-folder-creatable-p ((folder elmo-nntp-folder))
nil)
-(luna-define-method elmo-folder-writable-p ((folder elmo-nntp-folder))
- nil)
-
(defun elmo-nntp-parse-newsgroups (string &optional subscribe-only)
(let ((nglist (elmo-parse string "[ \t\f\r\n,]*\\([^ \t\f\r\n,]+\\)"))
ngs)
(and (elmo-folder-creatable-p (elmo-pipe-folder-src-internal folder))
(elmo-folder-creatable-p (elmo-pipe-folder-dst-internal folder))))
+(luna-define-method elmo-folder-writable-p ((folder elmo-pipe-folder))
+ (elmo-folder-writable-p (elmo-pipe-folder-dst-internal folder)))
+
(luna-define-method elmo-folder-create ((folder elmo-pipe-folder))
(if (and (not (elmo-folder-exists-p (elmo-pipe-folder-src-internal folder)))
(elmo-folder-creatable-p (elmo-pipe-folder-src-internal folder)))
t) ; default is creatable.
(luna-define-method elmo-folder-writable-p ((folder elmo-folder))
- t) ; default is writable.
+ nil) ; default is not writable.
(luna-define-method elmo-folder-rename ((folder elmo-folder) new-name)
(let* ((new-folder (elmo-make-folder new-name)))
succeeds i result)
(if (eq dst-folder 'null)
(setq succeeds messages)
- ;; src is already opened.
+ (unless (elmo-folder-writable-p dst-folder)
+ (error "move: %d is not writable"
+ (elmo-folder-name-internal dst-folder)))
(when messages
+ ;; src is already opened.
(elmo-folder-open-internal dst-folder)
(unless (setq succeeds (elmo-folder-append-messages dst-folder
src-folder
(if (not no-delete-info)
(message "Cleaning up src folder..."))
(if (and (elmo-folder-delete-messages src-folder succeeds)
- (elmo-msgdb-delete-msgs
+ (elmo-msgdb-delete-msgs
(elmo-folder-msgdb src-folder) succeeds))
(setq result t)
(message "move: delete messages from %s failed."