Ted Zlatanov <[email protected]> writes:
> I made many other fixes so please use the attached file as a baseline if
> you want to submit patches for any of the issues I listed before, or any
> new issues you notice. It's getting close to usable.
I've started to play with it. First error:
Debugger entered--Lisp error: (wrong-number-of-arguments #[nil "dbÀÁÂÃ#
" nil t delete-char 1] 4
("/usr/local/share/emacs/23.0.92/lisp/gnus/nnheader.elc" . 25599)] 1)
nnheader-ms-strip-cr("X-Tramp-Imap: *scratch*
\nFrom: Tramp-Imap <[email protected]>
\nTo: Tramp-Imap <[email protected]>
\nSubject: tramp-imap-subject-marker fstab
\nDate: Sat, 25 Apr 2009 19:08:13 +0200
\nMessage-ID: <[email protected]>
\n
\n")
tramp-imap-get-message-headers(1)
(nnheader-ms-strip-cr (tramp-imap-get-message-headers msgs))
(let ((headers ...)) (when (string-match "^X-Tramp-IMAP: \\(.+\\)" headers)
(match-string 1 headers)))
tramp-imap-get-message-x-tramp-imap(1)
(setq sname (tramp-imap-get-message-x-tramp-imap msg))
(while --cl-dolist-temp-- (setq msg (car --cl-dolist-temp--)) (setq sname
(tramp-imap-get-message-x-tramp-imap msg)) (when (and sname ...) (push ... res)
(tramp-debug-message vec "found message %s: %s" msg ...)) (setq
--cl-dolist-temp-- (cdr --cl-dolist-temp--)))
(let ((--cl-dolist-temp-- ...) msg) (while --cl-dolist-temp-- (setq msg ...)
(setq sname ...) (when ... ... ...) (setq --cl-dolist-temp-- ...)) nil)
(catch (quote --cl-block-nil--) (let (... msg) (while --cl-dolist-temp-- ...
... ... ...) nil))
(cl-block-wrapper (catch (quote --cl-block-nil--) (let ... ... nil)))
(block nil (let (... msg) (while --cl-dolist-temp-- ... ... ... ...) nil))
(dolist (msg (imap-search ...)) (setq sname
(tramp-imap-get-message-x-tramp-imap msg)) (when (and sname ...) (push ... res)
(tramp-debug-message vec "found message %s: %s" msg ...)))
(let (sname) (tramp-debug-message vec "looking for '%s'" search-name) (dolist
(msg ...) (setq sname ...) (when ... ... ...)))
(if (and name (imap-mailbox-select mbox)) (let (sname) (tramp-debug-message
vec "looking for '%s'" search-name) (dolist ... ... ...)) (tramp-error vec
(quote none) "bad name %s or mailbox %s" name mbox))
(let* ((mbox ...) (name ...) (truename ...) (search-name ...) res)
(tramp-debug-message vec "selecting mbox %s" mbox) (if (and name ...) (let ...
... ...) (tramp-error vec ... "bad name %s or mailbox %s" name mbox)) res)
(save-current-buffer (set-buffer (tramp-imap-buffer vec)) (let* (... ... ...
... res) (tramp-debug-message vec "selecting mbox %s" mbox) (if ... ... ...)
res))
(with-current-buffer (tramp-imap-buffer vec) (let* (... ... ... ... res)
(tramp-debug-message vec "selecting mbox %s" mbox) (if ... ... ...) res))
tramp-imap-get-file-entries(["imap" "albinus" "localhost" "/INBOX.test"])
(car (tramp-imap-get-file-entries v))
(cdr (car (tramp-imap-get-file-entries v)))
(progn (cdr (car ...)))
(setq value (progn (cdr ...)))
(progn (setq value (progn ...)) (tramp-set-file-property v localname (format
"file-attributes-%s" id-format) value))
(if (eq value (quote undef)) (progn (setq value ...) (tramp-set-file-property
v localname ... value)))
(when (eq value (quote undef)) (setq value (progn ...))
(tramp-set-file-property v localname (format "file-attributes-%s" id-format)
value))
(let ((value ...)) (when (eq value ...) (setq value ...)
(tramp-set-file-property v localname ... value)) value)
(if (file-name-absolute-p localname) (let (...) (when ... ... ...) value)
(cdr (car ...)))
(with-file-property v localname (format "file-attributes-%s" id-format) (cdr
(car ...)))
(let* ((v ...) (method ...) (user ...) (host ...) (localname ...))
(with-file-property v localname (format "file-attributes-%s" id-format) (cdr
...)))
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-file-property v localname (format "file-attributes-%s" id-format) (cdr
...)))
tramp-imap-handle-file-attributes("/imap:albi...@localhost:/INBOX.test")
apply(tramp-imap-handle-file-attributes "/imap:albi...@localhost:/INBOX.test")
(progn (apply (cdr fn) args))
(unwind-protect (progn (apply ... args)) (set-match-data
save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...)))
(save-match-data (apply (cdr fn) args))
(if fn (save-match-data (apply ... args)) (tramp-run-real-handler operation
args))
(let ((fn ...)) (if fn (save-match-data ...) (tramp-run-real-handler
operation args)))
tramp-imap-file-name-handler(file-attributes
"/imap:albi...@localhost:/INBOX.test")
apply(tramp-imap-file-name-handler file-attributes
"/imap:albi...@localhost:/INBOX.test")
(cond ((and completion ... ...) t) ((and completion ... ...) filename)
(foreign (apply foreign operation args)) (t (tramp-run-real-handler operation
args)))
(let* ((v ...) (method ...) (user ...) (host ...) (localname ...)) (cond (...
t) (... filename) (foreign ...) (t ...)))
(with-parsed-tramp-file-name filename nil (cond (... t) (... filename)
(foreign ...) (t ...)))
(let* ((filename ...) (completion ...) (foreign ...))
(with-parsed-tramp-file-name filename nil (cond ... ... ... ...)))
(progn (let* (... ... ...) (with-parsed-tramp-file-name filename nil ...)))
(unwind-protect (progn (let* ... ...)) (set-match-data
save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...)))
(save-match-data (let* (... ... ...) (with-parsed-tramp-file-name filename
nil ...)))
(if tramp-mode (save-match-data (let* ... ...)) (tramp-run-real-handler
operation args))
tramp-file-name-handler(file-attributes "/imap:albi...@localhost:/INBOX.test")
file-attributes("/imap:albi...@localhost:/INBOX.test")
(car (file-attributes filename))
(let ((x ...)) (when (stringp x) (if ... ... x)))
(let* ((v ...) (method ...) (user ...) (host ...) (localname ...)) (let (...)
(when ... ...)))
(with-parsed-tramp-file-name filename nil (let (...) (when ... ...)))
tramp-handle-file-symlink-p("/imap:albi...@localhost:/INBOX.test")
apply(tramp-handle-file-symlink-p "/imap:albi...@localhost:/INBOX.test")
(progn (apply (cdr fn) args))
(unwind-protect (progn (apply ... args)) (set-match-data
save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...)))
(save-match-data (apply (cdr fn) args))
(if fn (save-match-data (apply ... args)) (tramp-run-real-handler operation
args))
(let ((fn ...)) (if fn (save-match-data ...) (tramp-run-real-handler
operation args)))
tramp-imap-file-name-handler(file-symlink-p
"/imap:albi...@localhost:/INBOX.test")
apply(tramp-imap-file-name-handler file-symlink-p
"/imap:albi...@localhost:/INBOX.test")
(cond ((and completion ... ...) t) ((and completion ... ...) filename)
(foreign (apply foreign operation args)) (t (tramp-run-real-handler operation
args)))
(let* ((v ...) (method ...) (user ...) (host ...) (localname ...)) (cond (...
t) (... filename) (foreign ...) (t ...)))
(with-parsed-tramp-file-name filename nil (cond (... t) (... filename)
(foreign ...) (t ...)))
(let* ((filename ...) (completion ...) (foreign ...))
(with-parsed-tramp-file-name filename nil (cond ... ... ... ...)))
(progn (let* (... ... ...) (with-parsed-tramp-file-name filename nil ...)))
(unwind-protect (progn (let* ... ...)) (set-match-data
save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...)))
(save-match-data (let* (... ... ...) (with-parsed-tramp-file-name filename
nil ...)))
(if tramp-mode (save-match-data (let* ... ...)) (tramp-run-real-handler
operation args))
tramp-file-name-handler(file-symlink-p "/imap:albi...@localhost:/INBOX.test")
file-symlink-p("/imap:albi...@localhost:/INBOX.test")
file-truename("/imap:albi...@localhost:/INBOX.test" (98) (nil))
file-truename("/imap:albi...@localhost:/INBOX.test/bbb")
apply(file-truename "/imap:albi...@localhost:/INBOX.test/bbb")
(let* ((inhibit-file-name-handlers ...) (inhibit-file-name-operation
operation)) (apply operation args))
tramp-run-real-handler(file-truename
("/imap:albi...@localhost:/INBOX.test/bbb"))
(if fn (save-match-data (apply ... args)) (tramp-run-real-handler operation
args))
(let ((fn ...)) (if fn (save-match-data ...) (tramp-run-real-handler
operation args)))
tramp-imap-file-name-handler(file-truename
"/imap:albi...@localhost:/INBOX.test/bbb")
apply(tramp-imap-file-name-handler file-truename
"/imap:albi...@localhost:/INBOX.test/bbb")
(cond ((and completion ... ...) t) ((and completion ... ...) filename)
(foreign (apply foreign operation args)) (t (tramp-run-real-handler operation
args)))
(let* ((v ...) (method ...) (user ...) (host ...) (localname ...)) (cond (...
t) (... filename) (foreign ...) (t ...)))
(with-parsed-tramp-file-name filename nil (cond (... t) (... filename)
(foreign ...) (t ...)))
(let* ((filename ...) (completion ...) (foreign ...))
(with-parsed-tramp-file-name filename nil (cond ... ... ... ...)))
(progn (let* (... ... ...) (with-parsed-tramp-file-name filename nil ...)))
(unwind-protect (progn (let* ... ...)) (set-match-data
save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...)))
(save-match-data (let* (... ... ...) (with-parsed-tramp-file-name filename
nil ...)))
(if tramp-mode (save-match-data (let* ... ...)) (tramp-run-real-handler
operation args))
tramp-file-name-handler(file-truename
"/imap:albi...@localhost:/INBOX.test/bbb")
file-truename("/imap:albi...@localhost:/INBOX.test/bbb")
set-visited-file-name("/imap:localhost:INBOX.test/bbb" nil)
write-file("/imap:localhost:INBOX.test/bbb" t)
call-interactively(write-file nil nil)
I'm using gnus as built in GNU Emacs 23.0.92. `nnheader-ms-strip-cr'
has no argument there.
You use by default 'ssl for connection. Can we expect this to be the
standard? Or shall we let the user decide, for example by two methods
"imap" and "imaps"?
I've also applied some few patches, you might check. See appended.
> Thanks
> Ted
Best regards, Michael.
*** /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
_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel