*** /home/albinus/lisp/tramp-imap.el.~1~ 2009-04-25 18:27:52.000000000 +0200 --- /home/albinus/lisp/tramp-imap.el 2009-04-25 19:03:27.000000000 +0200 *************** *** 261,269 **** ;; ... and add it to the method list. (add-to-list 'tramp-methods (cons tramp-imap-method nil)) - ;; ... and add it to the method list. - (add-to-list 'tramp-methods (cons tramp-imap-method nil)) - ;; Add a default for `tramp-default-user-alist'. Default is the local user. (add-to-list 'tramp-default-user-alist `(,tramp-imap-method nil ,(user-login-name))) --- 261,266 ---- *************** *** 336,354 **** "Alist of handler functions for Tramp IMAP method. Operations not mentioned here will be handled by the default Emacs primitives.") - (defgroup tramp-imap nil - "Tramp over IMAP configuration." - :group 'applications) - (defcustom tramp-imap-subject-marker "tramp-imap-subject-marker" "The subject marker that Tramp-Imap will use." :type 'string ! :group 'tramp-imap) (defcustom tramp-imap-passphrase "my passphrase" "The passphrase that Tramp-Imap will use. TODO: allow function calls, etc. here" :type 'string ! :group 'tramp-imap) (defun tramp-imap-file-name-p (filename) "Check if it's a filename for IMAP protocol." --- 333,347 ---- "Alist of handler functions for Tramp IMAP method. Operations not mentioned here will be handled by the default Emacs primitives.") (defcustom tramp-imap-subject-marker "tramp-imap-subject-marker" "The subject marker that Tramp-Imap will use." :type 'string ! :group 'tramp) (defcustom tramp-imap-passphrase "my passphrase" "The passphrase that Tramp-Imap will use. TODO: allow function calls, etc. here" :type 'string ! :group 'tramp) (defun tramp-imap-file-name-p (filename) "Check if it's a filename for IMAP protocol." *************** *** 410,416 **** (save-match-data (let ((entries (with-file-property v localname "file-entries" ! (tramp-imap-get-file-entries v localname)))) (mapcar (lambda (x) (list --- 403,409 ---- (save-match-data (let ((entries (with-file-property v localname "file-entries" ! (tramp-imap-get-file-entries v)))) (mapcar (lambda (x) (list *************** *** 421,431 **** ;;; (tramp-imap-get-file-entries (tramp-dissect-file-name "/imap:blockstar.com:/INBOX.test/fstab") t) ! (defun tramp-imap-get-file-entries (vec localname &optional exact) "Read entries returned by IMAP server. EXACT limits to exact matches. Result is a list of (LOCALNAME LINK COUNT UID GID ATIME MTIME CTIME SIZE MODE WEIRD INODE DEVICE)." ! (tramp-debug-message vec "working on %s" localname) (with-current-buffer (tramp-imap-buffer vec) (let* ((mbox (tramp-imap-file-name-mailbox vec)) (name (tramp-imap-file-name-name vec)) --- 414,424 ---- ;;; (tramp-imap-get-file-entries (tramp-dissect-file-name "/imap:blockstar.com:/INBOX.test/fstab") t) ! (defun tramp-imap-get-file-entries (vec &optional exact) "Read entries returned by IMAP server. EXACT limits to exact matches. Result is a list of (LOCALNAME LINK COUNT UID GID ATIME MTIME CTIME SIZE MODE WEIRD INODE DEVICE)." ! (tramp-debug-message vec "working on %s" (tramp-file-name-localname vec)) (with-current-buffer (tramp-imap-buffer vec) (let* ((mbox (tramp-imap-file-name-mailbox vec)) (name (tramp-imap-file-name-name vec)) *************** *** 516,522 **** (let ((point (point)) size data) (tramp-message v 4 "Fetching file %s..." filename) ! (let* ((found (tramp-imap-get-file-entries v filename)) ;; inode is the message UID; we use the first message found (uid (nth 11 (nth 0 found)))) (when found --- 509,515 ---- (let ((point (point)) size data) (tramp-message v 4 "Fetching file %s..." filename) ! (let* ((found (tramp-imap-get-file-entries v)) ;; inode is the message UID; we use the first message found (uid (nth 11 (nth 0 found)))) (when found *************** *** 547,553 **** "Like `file-attributes' for Tramp files." (with-parsed-tramp-file-name (expand-file-name filename) nil (with-file-property v localname (format "file-attributes-%s" id-format) ! (cdr (car (tramp-imap-get-file-entries v localname)))))) (defun tramp-imap-handle-file-executable-p (filename) "Like `file-executable-p' for Tramp files. False for IMAP." --- 540,546 ---- "Like `file-attributes' for Tramp files." (with-parsed-tramp-file-name (expand-file-name filename) nil (with-file-property v localname (format "file-attributes-%s" id-format) ! (cdr (car (tramp-imap-get-file-entries v)))))) (defun tramp-imap-handle-file-executable-p (filename) "Like `file-executable-p' for Tramp files. False for IMAP." *************** *** 651,664 **** ;;; (with-current-buffer (tramp-imap-buffer (tramp-dissect-file-name "/imap:blockstar.com:/INBOX.test/new")) (tramp-imap-get-message-subject 24)) (defun tramp-imap-get-message-subject (msgs) "Get message subject over IMAP." ! (let ((allsubject ! (nnheader-ms-strip-cr ! (nth 2 (nth 0 (imap-fetch msgs ! "BODY[HEADER.FIELDS (SUBJECT)]" 'BODYDETAIL)))))) ! (when (string-match