tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp-IMAP works and needs testing


From: Michael Albinus
Subject: Re: Tramp-IMAP works and needs testing
Date: Tue, 08 Sep 2009 15:33:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Ted Zlatanov <address@hidden> writes:

> On Sat, 18 Jul 2009 13:11:51 +0200 Michael Albinus <address@hidden> wrote:
>
> MA> - Several functions in `tramp-imap-file-name-handler-alist' are not
> MA>   implemented yet.
>
> I'm trying to get basic file read/write working before those other
> functions.  Should I just set them to nil for now?

We could set them to `ignore', and add a comment. I've done it for all
functions with a missing implementation.

> MA> - `tramp-imap-handle-file-directory-p' must not return nil in all
> MA>   cases. When I apply (save-buffer), the imap folder is checked for
> MA>   being a directory. As workaround, I've changed
> MA>   `tramp-imap-handle-file-directory-p' to return `t', but it must be
> MA>   more precise.
>
> This is actually tough, because an entry could be both.  We could have
> the files INBOX.test/b and INBOX.test/b/c at the same time.  I will have
> to make the directory name the mailbox name and everything above that
> the filename.  Thus no subdirectories are allowed, which simplifies the
> logic.  Otherwise I don't think Tramp can handle it.  So:
>
> /imap:address@hidden:/INBOX.test = directory
> /imap:address@hidden:/INBOX.test/ = directory
> /imap:address@hidden:/INBOX.test/1 = file "1"
> /imap:address@hidden:/INBOX.test/1/2 = illegal file name
>
> I think that's sufficient for most users.  I hate to kill functionality
> this way, but otherwise things will get too confusing.  Does that sound
> OK to you?

OK. I've added a corresponding implementation.

Problems:

`tramp-imap-buffer' can return nil, if the connection to IMAP fails. You
always use (with-current-buffer (tramp-imap-buffer vec) ...), which
gives an error then. It might be better to check the result of
`tramp-imap-buffer' first.

`tramp-imap-handle-name-all-completions' does not complete mailbox names.

If you apply `write-file', and the file exists already on the IMAP
server, a second file with the same name (subject) will be written
instead of overwriting the existing one.

In `tramp-imap-buffer', you use auth-source in order to determine user
and password. I believe, it shall be rather done via `tramp-read-passwd'
(which includes auth-source). By this, the user name given in the Tramp
filename is respected. Furthermore, I plan to add more password handling
mechanisms there, for example the Secret Service API for gnome-keyring
and kwallet.

Furthermore, I've changed the following:

- Change the copyright owner to FSF. I hope you are OK with this;
  otherwise we have no chance to add your package to Tramp and Emacs.

- Make `tramp-imap-method' and `tramp-imaps-method' a defconst. I know
  that in some other tramp-*.el files the methods are also defcustom's,
  but I don't believe it is necessary (and I shall change it everywhere).

- Change implementation of `tramp-imap-handle-file-readable-p ' and
  `tramp-imap-handle-file-writable-p'.

After all, it is working already pretty fine. I believe we shall add it
to Tramp's CVS repository, and likely we shall add it also to the
upcoming Tramp 2.1.17 release (maybe marked as experimental).

> Ted

Best regards, Michael.

Attachment: tramp-imap.el
Description: application/emacs-lisp


reply via email to

[Prev in Thread] Current Thread [Next in Thread]