Mercurial > emacs
annotate lisp/net/tramp-imap.el @ 112353:71904feb29f6
Improve performance on non-GCC hosts with __aligned__.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 17 Jan 2011 20:55:12 -0800 |
parents | 417b1e4d63cd |
children |
rev | line source |
---|---|
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1 ;;; tramp-imap.el --- Tramp interface to IMAP through imap.el |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
2 |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
110121
diff
changeset
|
3 ;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
4 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
5 ;; Author: Teodor Zlatanov <tzz@lifelogs.com> |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
6 ;; Keywords: mail, comm |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
108816
diff
changeset
|
7 ;; Package: tramp |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
8 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
10 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
14 ;; (at your option) any later version. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
15 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
19 ;; GNU General Public License for more details. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
20 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
23 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
24 ;;; Commentary: |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
25 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
26 ;; Package to provide Tramp over IMAP |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
27 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
28 ;;; Setup: |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
29 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
30 ;; just load and open files, e.g. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
31 ;; /imaps:user@yourhosthere.com:/INBOX.test/1 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
32 ;; or |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
33 ;; /imap:user@yourhosthere.com:/INBOX.test/1 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
34 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
35 ;; where `imap' goes over IMAP, while `imaps' goes over IMAP+SSL |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
36 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
37 ;; This module will use imap-hash.el to access the IMAP mailbox. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
38 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
39 ;; This module will use auth-source.el to authenticate against the |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
40 ;; IMAP server, PLUS it will use auth-source.el to get your passphrase |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
41 ;; for the symmetrically encrypted messages. For the former, use the |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
42 ;; usual IMAP ports. For the latter, use the port "tramp-imap". |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
43 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
44 ;; example .authinfo / .netrc file: |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
45 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
46 ;; machine yourhosthere.com port tramp-imap login USER password SYMMETRIC-PASSPHRASE |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
47 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
48 ;; note above is the symmetric encryption passphrase for GPG |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
49 ;; below is the regular password for IMAP itself and other things on that host |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
50 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
51 ;; machine yourhosthere.com login USER password NORMAL-PASSWORD |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
52 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
53 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
54 ;;; Code: |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
55 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
56 (require 'assoc) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
57 (require 'tramp) |
106954
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
58 |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
59 (autoload 'auth-source-user-or-password "auth-source") |
106954
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
60 (autoload 'epg-context-operation "epg") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
61 (autoload 'epg-context-set-armor "epg") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
62 (autoload 'epg-context-set-passphrase-callback "epg") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
63 (autoload 'epg-context-set-progress-callback "epg") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
64 (autoload 'epg-decrypt-string "epg") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
65 (autoload 'epg-encrypt-string "epg") |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
66 (autoload 'epg-make-context "epg") |
106954
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
67 (autoload 'imap-hash-get "imap-hash") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
68 (autoload 'imap-hash-make "imap-hash") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
69 (autoload 'imap-hash-map "imap-hash") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
70 (autoload 'imap-hash-put "imap-hash") |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
71 (autoload 'imap-hash-rem "imap-hash") |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
72 |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
73 ;; We use the additional header "X-Size" for encoding the size of a file. |
106954
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
74 (eval-after-load "imap-hash" |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
75 '(add-to-list 'imap-hash-headers 'X-Size 'append)) |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
76 |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
77 ;; Define Tramp IMAP method ... |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
78 ;;;###tramp-autoload |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
79 (defconst tramp-imap-method "imap" |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
80 "*Method to connect via IMAP protocol.") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
81 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
82 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
83 (when (and (locate-library "epa") (locate-library "imap-hash")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
84 (add-to-list 'tramp-methods |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
85 (list tramp-imap-method '(tramp-default-port 143)))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
86 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
87 ;; Define Tramp IMAPS method ... |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
88 ;;;###tramp-autoload |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
89 (defconst tramp-imaps-method "imaps" |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
90 "*Method to connect via secure IMAP protocol.") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
91 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
92 ;; ... and add it to the method list. |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
93 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
94 (when (and (locate-library "epa") (locate-library "imap-hash")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
95 (add-to-list 'tramp-methods |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
96 (list tramp-imaps-method '(tramp-default-port 993)))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
97 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
98 ;; Add a default for `tramp-default-user-alist'. Default is the local user. |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111788
diff
changeset
|
99 ;;;###tramp-autoload |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
110776
diff
changeset
|
100 (add-to-list |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
110776
diff
changeset
|
101 'tramp-default-user-alist |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
110776
diff
changeset
|
102 (list (concat "\\`" |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
110776
diff
changeset
|
103 (regexp-opt (list tramp-imap-method tramp-imaps-method)) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
110776
diff
changeset
|
104 "\\'") |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
110776
diff
changeset
|
105 nil (user-login-name))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
106 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
107 ;; Add completion function for IMAP method. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
108 ;; (tramp-set-completion-function |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
109 ;; tramp-imap-method tramp-completion-function-alist-ssh) ; TODO: test this |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
110 ;; tramp-imaps-method tramp-completion-function-alist-ssh) ; TODO: test this |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
111 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
112 ;; New handlers should be added here. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
113 (defconst tramp-imap-file-name-handler-alist |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
114 '( |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
115 ;; `access-file' performed by default handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
116 (add-name-to-file . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
117 ;; `byte-compiler-base-file-name' performed by default handler |
105766
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
118 ;; `copy-directory' performed by default handler |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
119 (copy-file . tramp-imap-handle-copy-file) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
120 (delete-directory . ignore) ;; tramp-imap-handle-delete-directory) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
121 (delete-file . tramp-imap-handle-delete-file) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
122 ;; `diff-latest-backup-file' performed by default handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
123 (directory-file-name . tramp-handle-directory-file-name) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
124 (directory-files . tramp-handle-directory-files) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
125 (directory-files-and-attributes |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
126 . tramp-handle-directory-files-and-attributes) |
105766
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
127 (dired-call-process . ignore) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
128 ;; `dired-compress-file' performed by default handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
129 ;; `dired-uncache' performed by default handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
130 (expand-file-name . tramp-imap-handle-expand-file-name) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
131 ;; `file-accessible-directory-p' performed by default handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
132 (file-attributes . tramp-imap-handle-file-attributes) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
133 (file-directory-p . tramp-imap-handle-file-directory-p) |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
134 (file-executable-p . ignore) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
135 (file-exists-p . tramp-handle-file-exists-p) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
136 (file-local-copy . tramp-imap-handle-file-local-copy) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
137 (file-modes . tramp-handle-file-modes) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
138 (file-name-all-completions . tramp-imap-handle-file-name-all-completions) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
139 (file-name-as-directory . tramp-handle-file-name-as-directory) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
140 (file-name-completion . tramp-handle-file-name-completion) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
141 (file-name-directory . tramp-handle-file-name-directory) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
142 (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
143 ;; `file-name-sans-versions' performed by default handler |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
144 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
145 (file-ownership-preserved-p . ignore) |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
146 (file-readable-p . tramp-handle-file-exists-p) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
147 (file-regular-p . tramp-handle-file-regular-p) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
148 (file-remote-p . tramp-handle-file-remote-p) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
149 ;; `file-selinux-context' performed by default handler. |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
150 (file-symlink-p . tramp-handle-file-symlink-p) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
151 ;; `file-truename' performed by default handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
152 (file-writable-p . tramp-imap-handle-file-writable-p) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
153 (find-backup-file-name . tramp-handle-find-backup-file-name) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
154 ;; `find-file-noselect' performed by default handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
155 ;; `get-file-buffer' performed by default handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
156 (insert-directory . tramp-imap-handle-insert-directory) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
157 (insert-file-contents . tramp-imap-handle-insert-file-contents) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
158 (load . tramp-handle-load) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
159 (make-directory . ignore) ;; tramp-imap-handle-make-directory) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
160 (make-directory-internal . ignore) ;; tramp-imap-handle-make-directory-internal) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
161 (make-symbolic-link . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
162 (rename-file . tramp-imap-handle-rename-file) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
163 (set-file-modes . ignore) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
164 ;; `set-file-selinux-context' performed by default handler. |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
165 (set-file-times . ignore) ;; tramp-imap-handle-set-file-times) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
166 (set-visited-file-modtime . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
167 (shell-command . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
168 (substitute-in-file-name . tramp-handle-substitute-in-file-name) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
169 (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
170 (vc-registered . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
171 (verify-visited-file-modtime . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
172 (write-region . tramp-imap-handle-write-region) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
173 (executable-find . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
174 (start-file-process . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
175 (process-file . ignore) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
176 ) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
177 "Alist of handler functions for Tramp IMAP method. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
178 Operations not mentioned here will be handled by the default Emacs primitives.") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
179 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
180 (defgroup tramp-imap nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
181 "Tramp over IMAP configuration." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
182 :version "23.2" |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
183 :group 'tramp) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
184 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
185 (defcustom tramp-imap-subject-marker "tramp-imap-subject-marker" |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
186 "The subject marker that Tramp-IMAP will use." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
187 :type 'string |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
188 :version "23.2" |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
189 :group 'tramp-imap) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
190 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
191 ;; TODO: these will be defcustoms later. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
192 (defvar tramp-imap-passphrase-cache nil) ;; can be t or 'never |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
193 (defvar tramp-imap-passphrase nil) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
194 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
195 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
196 (defsubst tramp-imap-file-name-p (filename) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
197 "Check if it's a filename for IMAP protocol." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
198 (let ((v (tramp-dissect-file-name filename))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
199 (or |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
200 (string= (tramp-file-name-method v) tramp-imap-method) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
201 (string= (tramp-file-name-method v) tramp-imaps-method)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
202 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
203 ;;;###tramp-autoload |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
204 (defun tramp-imap-file-name-handler (operation &rest args) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
205 "Invoke the IMAP related OPERATION. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
206 First arg specifies the OPERATION, second arg is a list of arguments to |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
207 pass to the OPERATION." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
208 (let ((fn (assoc operation tramp-imap-file-name-handler-alist))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
209 (if fn |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
210 (save-match-data (apply (cdr fn) args)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
211 (tramp-run-real-handler operation args)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
212 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
213 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
214 (when (and (locate-library "epa") (locate-library "imap-hash")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
215 (add-to-list 'tramp-foreign-file-name-handler-alist |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
216 (cons 'tramp-imap-file-name-p 'tramp-imap-file-name-handler))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
217 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
218 (defun tramp-imap-handle-copy-file |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
219 (filename newname &optional ok-if-already-exists keep-date |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
220 preserve-uid-gid preserve-selinux-context) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
221 "Like `copy-file' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
222 (tramp-imap-do-copy-or-rename-file |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
223 'copy filename newname ok-if-already-exists keep-date preserve-uid-gid)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
224 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
225 (defun tramp-imap-handle-rename-file |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
226 (filename newname &optional ok-if-already-exists) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
227 "Like `rename-file' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
228 (tramp-imap-do-copy-or-rename-file |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
229 'rename filename newname ok-if-already-exists t t)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
230 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
231 (defun tramp-imap-do-copy-or-rename-file |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
232 (op filename newname &optional ok-if-already-exists keep-date preserve-uid-gid) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
233 "Copy or rename a remote file. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
234 OP must be `copy' or `rename' and indicates the operation to perform. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
235 FILENAME specifies the file to copy or rename, NEWNAME is the name of |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
236 the new file (for copy) or the new name of the file (for rename). |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
237 OK-IF-ALREADY-EXISTS means don't barf if NEWNAME exists already. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
238 KEEP-DATE means to make sure that NEWNAME has the same timestamp |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
239 as FILENAME. PRESERVE-UID-GID, when non-nil, instructs to keep |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
240 the uid and gid if both files are on the same host. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
241 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
242 This function is invoked by `tramp-imap-handle-copy-file' and |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
243 `tramp-imap-handle-rename-file'. It is an error if OP is neither |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
244 of `copy' and `rename'." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
245 (unless (memq op '(copy rename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
246 (error "Unknown operation `%s', must be `copy' or `rename'" op)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
247 (setq filename (expand-file-name filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
248 (setq newname (expand-file-name newname)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
249 (when (file-directory-p newname) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
250 (setq newname (expand-file-name (file-name-nondirectory filename) newname))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
251 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
252 (let ((t1 (and (tramp-tramp-file-p filename) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
253 (tramp-imap-file-name-p filename))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
254 (t2 (and (tramp-tramp-file-p newname) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
255 (tramp-imap-file-name-p newname)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
256 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
257 (with-parsed-tramp-file-name (if t1 filename newname) nil |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
258 (when (and (not ok-if-already-exists) (file-exists-p newname)) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
259 (tramp-error |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
260 v 'file-already-exists "File %s already exists" newname)) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
261 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
262 (with-progress-reporter |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
263 v 0 (format "%s %s to %s" |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
264 (if (eq op 'copy) "Copying" "Renaming") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
265 filename newname) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
266 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
267 ;; We just make a local copy of FILENAME, and write it then to |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
268 ;; NEWNAME. This must be optimized, when both files are |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
269 ;; located on the same IMAP server. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
270 (with-temp-buffer |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
271 (if (and t1 t2) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
272 ;; We don't encrypt. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
273 (with-parsed-tramp-file-name newname v1 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
274 (insert (tramp-imap-get-file filename nil)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
275 (tramp-imap-put-file |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
276 v1 (current-buffer) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
277 (tramp-imap-file-name-name v1) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
278 nil nil (nth 7 (file-attributes filename)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
279 ;; One of them is not located on a IMAP mailbox. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
280 (insert-file-contents filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
281 (write-region (point-min) (point-max) newname))))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
282 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
283 (when (eq op 'rename) (delete-file filename)))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
284 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
285 ;; TODO: revise this much |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
286 (defun tramp-imap-handle-expand-file-name (name &optional dir) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
287 "Like `expand-file-name' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
288 ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
289 (setq dir (or dir default-directory "/")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
290 ;; Unless NAME is absolute, concat DIR and NAME. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
291 (unless (file-name-absolute-p name) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
292 (setq name (concat (file-name-as-directory dir) name))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
293 ;; If NAME is not a Tramp file, run the real handler. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
294 (if (or (tramp-completion-mode-p) (not (tramp-tramp-file-p name))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
295 (tramp-drop-volume-letter |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
296 (tramp-run-real-handler 'expand-file-name (list name nil))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
297 ;; Dissect NAME. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
298 (with-parsed-tramp-file-name name nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
299 (unless (tramp-run-real-handler 'file-name-absolute-p (list localname)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
300 (setq localname (concat "/" localname))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
301 ;; There might be a double slash, for example when "~/" |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
302 ;; expands to "/". Remove this. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
303 (while (string-match "//" localname) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
304 (setq localname (replace-match "/" t t localname))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
305 ;; Do normal `expand-file-name' (this does "/./" and "/../"). |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
306 ;; We bind `directory-sep-char' here for XEmacs on Windows, |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
307 ;; which would otherwise use backslash. `default-directory' is |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
308 ;; bound, because on Windows there would be problems with UNC |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
309 ;; shares or Cygwin mounts. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
310 (let ((default-directory (tramp-compat-temporary-file-directory))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
311 (tramp-make-tramp-file-name |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
312 method user host |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
313 (tramp-drop-volume-letter |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
314 (tramp-run-real-handler |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
315 'expand-file-name (list localname)))))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
316 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
317 ;; This function should return "foo/" for directories and "bar" for |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
318 ;; files. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
319 (defun tramp-imap-handle-file-name-all-completions (filename directory) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
320 "Like `file-name-all-completions' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
321 (all-completions |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
322 filename |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
323 (with-parsed-tramp-file-name (expand-file-name directory) nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
324 (save-match-data |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
325 (let ((entries |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
326 (tramp-imap-get-file-entries v localname))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
327 (mapcar |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
328 (lambda (x) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
329 (list |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
330 (if (string-match "d" (nth 9 x)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
331 (file-name-as-directory (nth 0 x)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
332 (nth 0 x)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
333 entries)))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
334 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
335 (defun tramp-imap-get-file-entries (vec localname &optional exact) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
336 "Read entries returned by IMAP server. EXACT limits to exact matches. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
337 Result is a list of (LOCALNAME LINK COUNT UID GID ATIME MTIME CTIME |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
338 SIZE MODE WEIRD INODE DEVICE)." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
339 (tramp-message vec 5 "working on %s" localname) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
340 (let* ((name (tramp-imap-file-name-name vec)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
341 (search-name (or name "")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
342 (search-name (if exact (concat search-name "$") search-name)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
343 (iht (tramp-imap-make-iht vec search-name))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
344 ;; TODO: catch errors |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
345 ;; (tramp-error vec 'none "bad name %s or mailbox %s" name mbox)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
346 (imap-hash-map (lambda (uid headers body) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
347 (let ((subject (substring |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
348 (aget headers 'Subject "") |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
349 (length tramp-imap-subject-marker))) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
350 (from (aget headers 'From "")) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
351 (date (date-to-time (aget headers 'Date ""))) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
352 (size (string-to-number |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
353 (or (aget headers 'X-Size "0") "0")))) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
354 (setq from |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
355 (if (string-match "<\\([^@]+\\)@" from) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
356 (match-string 1 from) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
357 "nobody")) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
358 (list |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
359 subject |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
360 nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
361 -1 |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
362 from |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
363 "nogroup" |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
364 date |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
365 date |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
366 date |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
367 size |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
368 "-rw-rw-rw-" |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
369 nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
370 uid |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
371 (tramp-get-device vec)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
372 iht t))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
373 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
374 (defun tramp-imap-handle-write-region (start end filename &optional append visit lockname confirm) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
375 "Like `write-region' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
376 (setq filename (expand-file-name filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
377 (with-parsed-tramp-file-name filename nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
378 ;; XEmacs takes a coding system as the seventh argument, not `confirm'. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
379 (when (and (not (featurep 'xemacs)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
380 confirm (file-exists-p filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
381 (unless (y-or-n-p (format "File %s exists; overwrite anyway? " |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
382 filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
383 (tramp-error v 'file-error "File not overwritten"))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
384 (tramp-flush-file-property v localname) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
385 (let* ((old-buffer (current-buffer)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
386 (inode (tramp-imap-get-file-inode filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
387 (min 1) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
388 (max (point-max)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
389 ;; Make sure we have good start and end values. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
390 (start (or start min)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
391 (end (or end max)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
392 temp-buffer) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
393 (with-temp-buffer |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
394 (setq temp-buffer (if (and (eq start min) (eq end max)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
395 old-buffer |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
396 ;; If this is a region write, insert the substring. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
397 (insert |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
398 (with-current-buffer old-buffer |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
399 (buffer-substring-no-properties start end))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
400 (current-buffer))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
401 (tramp-imap-put-file v |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
402 temp-buffer |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
403 (tramp-imap-file-name-name v) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
404 inode |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
405 t))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
406 (when (eq visit t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
407 (set-visited-file-modtime)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
408 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
409 (defun tramp-imap-handle-insert-directory |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
410 (filename switches &optional wildcard full-directory-p) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
411 "Like `insert-directory' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
412 (setq filename (expand-file-name filename)) |
107092
2e763e444bc2
* net/ange-ftp.el (ange-ftp-insert-directory):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
413 (if full-directory-p |
2e763e444bc2
* net/ange-ftp.el (ange-ftp-insert-directory):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
414 ;; Called from `dired-add-entry'. |
2e763e444bc2
* net/ange-ftp.el (ange-ftp-insert-directory):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
415 (setq filename (file-name-as-directory filename)) |
2e763e444bc2
* net/ange-ftp.el (ange-ftp-insert-directory):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
416 (setq filename (directory-file-name filename))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
417 (with-parsed-tramp-file-name filename nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
418 (save-match-data |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
419 (let ((base (file-name-nondirectory localname)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
420 (entries (copy-sequence |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
421 (tramp-imap-get-file-entries |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
422 v (file-name-directory localname))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
423 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
424 (when wildcard |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
425 (when (string-match "\\." base) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
426 (setq base (replace-match "\\\\." nil nil base))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
427 (when (string-match "\\*" base) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
428 (setq base (replace-match ".*" nil nil base))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
429 (when (string-match "\\?" base) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
430 (setq base (replace-match ".?" nil nil base)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
431 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
432 ;; Filter entries. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
433 (setq entries |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
434 (delq |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
435 nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
436 (if (or wildcard (zerop (length base))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
437 ;; Check for matching entries. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
438 (mapcar |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
439 (lambda (x) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
440 (when (string-match |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
441 (format "^%s" base) (nth 0 x)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
442 x)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
443 entries) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
444 ;; We just need the only and only entry FILENAME. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
445 (list (assoc base entries))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
446 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
447 ;; Sort entries. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
448 (setq entries |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
449 (sort |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
450 entries |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
451 (lambda (x y) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
452 (if (string-match "t" switches) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
453 ;; Sort by date. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
454 (tramp-time-less-p (nth 6 y) (nth 6 x)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
455 ;; Sort by name. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
456 (string-lessp (nth 0 x) (nth 0 y)))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
457 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
458 ;; Handle "-F" switch. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
459 (when (string-match "F" switches) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
460 (mapc |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
461 (lambda (x) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
462 (when (not (zerop (length (car x)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
463 (cond |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
464 ((char-equal ?d (string-to-char (nth 9 x))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
465 (setcar x (concat (car x) "/"))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
466 ((char-equal ?x (string-to-char (nth 9 x))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
467 (setcar x (concat (car x) "*")))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
468 entries)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
469 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
470 ;; Print entries. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
471 (mapcar |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
472 (lambda (x) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
473 (when (not (zerop (length (nth 0 x)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
474 (insert |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
475 (format |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
476 "%10s %3d %-8s %-8s %8s %s " |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
477 (nth 9 x) ; mode |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
478 (nth 11 x) ; inode |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
479 (nth 3 x) ; uid |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
480 (nth 4 x) ; gid |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
481 (nth 8 x) ; size |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
482 (format-time-string |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
483 (if (tramp-time-less-p |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
484 (tramp-time-subtract (current-time) (nth 6 x)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
485 tramp-half-a-year) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
486 "%b %e %R" |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
487 "%b %e %Y") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
488 (nth 6 x)))) ; date |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
489 ;; For the file name, we set the `dired-filename' |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
490 ;; property. This allows to handle file names with |
107085
d7831d04952b
* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Michael Albinus <michael.albinus@gmx.de>
parents:
106955
diff
changeset
|
491 ;; leading or trailing spaces as well. The inserted name |
d7831d04952b
* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Michael Albinus <michael.albinus@gmx.de>
parents:
106955
diff
changeset
|
492 ;; could be from somewhere else, so we use the relative |
d7831d04952b
* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Michael Albinus <michael.albinus@gmx.de>
parents:
106955
diff
changeset
|
493 ;; file name of `default-directory'. |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
494 (let ((pos (point))) |
107085
d7831d04952b
* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Michael Albinus <michael.albinus@gmx.de>
parents:
106955
diff
changeset
|
495 (insert |
d7831d04952b
* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Michael Albinus <michael.albinus@gmx.de>
parents:
106955
diff
changeset
|
496 (format |
d7831d04952b
* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Michael Albinus <michael.albinus@gmx.de>
parents:
106955
diff
changeset
|
497 "%s\n" |
107092
2e763e444bc2
* net/ange-ftp.el (ange-ftp-insert-directory):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
498 (file-relative-name |
2e763e444bc2
* net/ange-ftp.el (ange-ftp-insert-directory):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
499 (expand-file-name (nth 0 x) (file-name-directory filename))))) |
107085
d7831d04952b
* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Michael Albinus <michael.albinus@gmx.de>
parents:
106955
diff
changeset
|
500 (put-text-property pos (1- (point)) 'dired-filename t)) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
501 (forward-line) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
502 (beginning-of-line))) |
107085
d7831d04952b
* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Michael Albinus <michael.albinus@gmx.de>
parents:
106955
diff
changeset
|
503 entries))))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
504 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
505 (defun tramp-imap-handle-insert-file-contents |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
506 (filename &optional visit beg end replace) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
507 "Like `insert-file-contents' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
508 (barf-if-buffer-read-only) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
509 (when visit |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
510 (setq buffer-file-name (expand-file-name filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
511 (set-visited-file-modtime) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
512 (set-buffer-modified-p nil)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
513 (with-parsed-tramp-file-name filename nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
514 (if (not (file-exists-p filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
515 (tramp-error |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
516 v 'file-error "File `%s' not found on remote host" filename) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
517 (let ((point (point)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
518 size data) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
519 (with-progress-reporter v 3 (format "Fetching file %s" filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
520 (insert (tramp-imap-get-file filename t)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
521 (setq size (- (point) point)) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
522 ;;; TODO: handle ranges. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
523 ;;; (let ((beg (or beg (point-min))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
524 ;;; (end (min (or end (point-max)) (point-max)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
525 ;;; (setq size (- end beg)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
526 ;;; (buffer-substring beg end)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
527 (goto-char point) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
528 (list (expand-file-name filename) size)))))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
529 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
530 (defun tramp-imap-handle-file-directory-p (filename) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
531 "Like `file-directory-p' for Tramp-IMAP files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
532 ;; We allow only mailboxes to be a directory. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
533 (with-parsed-tramp-file-name (expand-file-name filename default-directory) nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
534 (and (string-match "^/[^/]*$" (directory-file-name localname)) t))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
535 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
536 (defun tramp-imap-handle-file-attributes (filename &optional id-format) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
537 "Like `file-attributes' for Tramp-IMAP FILENAME." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
538 (with-parsed-tramp-file-name (expand-file-name filename) nil |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
539 (let ((res (cdr-safe (nth 0 (tramp-imap-get-file-entries v localname))))) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
540 (unless (or (null res) (eq id-format 'string)) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
541 (setcar (nthcdr 2 res) 1) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
542 (setcar (nthcdr 3 res) 1)) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
543 res))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
544 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
545 (defun tramp-imap-get-file-inode (filename &optional id-format) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
546 "Get inode equivalent \(actually the UID) for Tramp-IMAP FILENAME." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
547 (nth 10 (tramp-compat-file-attributes filename id-format))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
548 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
549 (defun tramp-imap-handle-file-writable-p (filename) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
550 "Like `file-writable-p' for Tramp files. True for IMAP." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
551 ;; `file-exists-p' does not work yet for directories. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
552 ;; (file-exists-p (file-name-directory filename))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
553 (file-directory-p (file-name-directory filename))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
554 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
555 (defun tramp-imap-handle-delete-file (filename &optional trash) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
556 "Like `delete-file' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
557 (cond |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
558 ((not (file-exists-p filename)) nil) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
559 (t (with-parsed-tramp-file-name (expand-file-name filename) nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
560 (let ((iht (tramp-imap-make-iht v))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
561 (imap-hash-rem (tramp-imap-get-file-inode filename) iht)))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
562 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
563 (defun tramp-imap-handle-file-local-copy (filename) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
564 "Like `file-local-copy' for Tramp files." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
565 (with-parsed-tramp-file-name (expand-file-name filename) nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
566 (unless (file-exists-p filename) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
567 (tramp-error |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
568 v 'file-error |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
569 "Cannot make local copy of non-existing file `%s'" filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
570 (let ((tmpfile (tramp-compat-make-temp-file filename))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
571 (with-progress-reporter |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
572 v 3 (format "Fetching %s to tmp file %s" filename tmpfile) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
573 (with-temp-buffer |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
574 (insert-file-contents filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
575 (write-region (point-min) (point-max) tmpfile) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107092
diff
changeset
|
576 tmpfile))))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
577 |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
578 (defun tramp-imap-put-file |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
579 (vec filename-or-buffer &optional subject inode encode size) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
580 "Write contents of FILENAME-OR-BUFFER to Tramp-IMAP file VEC with name SUBJECT. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
581 When INODE is given, delete that old remote file after writing the new one |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
582 \(normally this is the old file with the same name). A non-nil ENCODE |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
583 forces the encoding of the buffer or file. SIZE, when available, indicates |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
584 the file size; this is needed, if the file or buffer is already encoded." |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
585 ;; `tramp-current-host' is used in `tramp-imap-passphrase-callback-function'. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
586 (let ((tramp-current-host (tramp-file-name-real-host vec)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
587 (iht (tramp-imap-make-iht vec))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
588 (imap-hash-put (list |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
589 (list (cons |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
590 'Subject |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
591 (format |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
592 "%s%s" |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
593 tramp-imap-subject-marker |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
594 (or subject "no subject"))) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
595 (cons |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
596 'X-Size |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
597 (number-to-string |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
598 (cond |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
599 ((numberp size) size) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
600 ((bufferp filename-or-buffer) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
601 (buffer-size filename-or-buffer)) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
602 ((stringp filename-or-buffer) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
603 (nth 7 (file-attributes filename-or-buffer))) |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
604 ;; We don't know the size. |
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
605 (t -1))))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
606 (cond ((bufferp filename-or-buffer) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
607 (with-current-buffer filename-or-buffer |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
608 (if encode |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
609 (tramp-imap-encode-buffer) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
610 (buffer-string)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
611 ;; TODO: allow file names. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
612 (t "No body available"))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
613 iht |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
614 inode))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
615 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
616 (defun tramp-imap-get-file (filename &optional decode) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
617 ;; (debug (tramp-imap-get-file-inode filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
618 (with-parsed-tramp-file-name (expand-file-name filename) nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
619 (condition-case () |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
620 ;; `tramp-current-host' is used in |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
621 ;; `tramp-imap-passphrase-callback-function'. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
622 (let* ((tramp-current-host (tramp-file-name-real-host v)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
623 (iht (tramp-imap-make-iht v)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
624 (inode (tramp-imap-get-file-inode filename)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
625 (data (imap-hash-get inode iht t))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
626 (if decode |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
627 (with-temp-buffer |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
628 (insert (nth 1 data)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
629 ;;(debug inode (buffer-string)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
630 (tramp-imap-decode-buffer)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
631 (nth 1 data))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
632 (error (tramp-error |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
633 v 'file-error "File `%s' could not be read" filename))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
634 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
635 (defun tramp-imap-passphrase-callback-function (context key-id handback) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
636 "Called by EPG to get a passphrase for Tramp-IMAP. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
637 CONTEXT is the encryption/decryption EPG context. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
638 HANDBACK is just carried through. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
639 KEY-ID can be 'SYM or 'PIN among others." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
640 (let* ((server tramp-current-host) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
641 (port "tramp-imap") ; this is NOT the server password! |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
642 (auth-passwd |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
643 (auth-source-user-or-password "password" server port))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
644 (or |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
645 (copy-sequence auth-passwd) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
646 ;; If we cache the passphrase and we have one. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
647 (if (and (eq tramp-imap-passphrase-cache t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
648 tramp-imap-passphrase) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
649 ;; Do we reuse it? |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
650 (if (y-or-n-p "Reuse the passphrase? ") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
651 (copy-sequence tramp-imap-passphrase) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
652 ;; Don't reuse: revert caching behavior to nil, erase passphrase, |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
653 ;; call ourselves again. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
654 (setq tramp-imap-passphrase-cache nil) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
655 (setq tramp-imap-passphrase nil) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
656 (tramp-imap-passphrase-callback-function context key-id handback)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
657 (let ((p (if (eq key-id 'SYM) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
658 (read-passwd |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
659 "Tramp-IMAP passphrase for symmetric encryption: " |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
660 (eq (epg-context-operation context) 'encrypt) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
661 tramp-imap-passphrase) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
662 (read-passwd |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
663 (if (eq key-id 'PIN) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
664 "Tramp-IMAP passphrase for PIN: " |
106954
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
665 (let ((entry (assoc key-id |
b21e977d14e7
* net/tramp-imap.el (top): Autoload needed packages.
Michael Albinus <michael.albinus@gmx.de>
parents:
106815
diff
changeset
|
666 (symbol-value 'epg-user-id-alist)))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
667 (if entry |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
668 (format "Tramp-IMAP passphrase for %s %s: " |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
669 key-id (cdr entry)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
670 (format "Tramp-IMAP passphrase for %s: " key-id)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
671 nil |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
672 tramp-imap-passphrase)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
673 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
674 ;; If we have an answer, the passphrase has changed, |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
675 ;; the user hasn't declined keeping the passphrase, |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
676 ;; and they answer yes to keep it now... |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
677 (when (and |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
678 p |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
679 (not (equal tramp-imap-passphrase p)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
680 (not (eq tramp-imap-passphrase-cache 'never)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
681 (y-or-n-p "Keep the passphrase? ")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
682 (setq tramp-imap-passphrase (copy-sequence p)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
683 (setq tramp-imap-passphrase-cache t)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
684 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
685 ;; If we still don't have a passphrase, the user didn't want |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
686 ;; to keep it. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
687 (when (and |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
688 p |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
689 (not tramp-imap-passphrase)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
690 (setq tramp-imap-passphrase-cache 'never)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
691 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
692 p))))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
693 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
694 (defun tramp-imap-encode-buffer () |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
695 (let ((context (epg-make-context 'OpenPGP)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
696 cipher) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
697 (epg-context-set-armor context t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
698 (epg-context-set-passphrase-callback context |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
699 #'tramp-imap-passphrase-callback-function) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
700 (epg-context-set-progress-callback context |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
701 (cons #'epa-progress-callback-function |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
702 "Encrypting...")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
703 (message "Encrypting...") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
704 (setq cipher (epg-encrypt-string |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
705 context |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
706 (encode-coding-string (buffer-string) 'utf-8) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
707 nil)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
708 (message "Encrypting...done") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
709 cipher)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
710 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
711 (defun tramp-imap-decode-buffer () |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
712 (let ((context (epg-make-context 'OpenPGP)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
713 plain) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
714 (epg-context-set-passphrase-callback context |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
715 #'tramp-imap-passphrase-callback-function) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
716 (epg-context-set-progress-callback context |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
717 (cons #'epa-progress-callback-function |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
718 "Decrypting...")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
719 (message "Decrypting...") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
720 (setq plain (decode-coding-string |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
721 (epg-decrypt-string context (buffer-string)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
722 'utf-8)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
723 (message "Decrypting...done") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
724 plain)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
725 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
726 (defun tramp-imap-file-name-mailbox (vec) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
727 (nth 0 (tramp-imap-file-name-parse vec))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
728 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
729 (defun tramp-imap-file-name-name (vec) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
730 (nth 1 (tramp-imap-file-name-parse vec))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
731 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
732 (defun tramp-imap-file-name-localname (vec) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
733 (nth 1 (tramp-imap-file-name-parse vec))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
734 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
735 (defun tramp-imap-file-name-parse (vec) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
736 (let ((name (substring-no-properties (tramp-file-name-localname vec)))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
737 (if (string-match "^/\\([^/]+\\)/?\\(.*\\)$" name) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
738 (list (match-string 1 name) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
739 (match-string 2 name)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
740 nil))) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
741 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
742 (defun tramp-imap-make-iht (vec &optional needed-subject) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
743 "Translate the Tramp vector VEC to the imap-hash structure. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
744 With NEEDED-SUBJECT, alters the imap-hash test accordingly." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
745 (let* ((mbox (tramp-imap-file-name-mailbox vec)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
746 (server (tramp-file-name-real-host vec)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
747 (method (tramp-file-name-method vec)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
748 (user (tramp-file-name-user vec)) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
749 (ssl (string-equal method tramp-imaps-method)) |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
110776
diff
changeset
|
750 (port (tramp-file-name-port vec)) |
105766
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
751 (result (imap-hash-make server port mbox user nil ssl))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
752 ;; Return the IHT with a test override to look for the subject |
105766
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
753 ;; marker. |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
754 (plist-put |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
755 result |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
756 :test (format "^%s%s" |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
757 tramp-imap-subject-marker |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
758 (if needed-subject needed-subject ""))))) |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
759 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
760 (add-hook 'tramp-unload-hook |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
761 (lambda () |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
762 (unload-feature 'tramp-imap 'force))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
763 |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
764 ;;; TODO: |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
765 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
766 ;; * Implement `tramp-imap-handle-delete-directory', |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
767 ;; `tramp-imap-handle-make-directory', |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
768 ;; `tramp-imap-handle-make-directory-internal', |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
769 ;; `tramp-imap-handle-set-file-times'. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
770 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
771 ;; * Encode the subject. If the filename has trailing spaces (like |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
772 ;; "test "), those characters get lost, for example in dired listings. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
773 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
774 ;; * When opening a dired buffer, like "/imap::INBOX.test", there are |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
775 ;; several error messages: |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
776 ;; "Buffer has a running process; kill it? (yes or no) " |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
777 ;; "error in process filter: Internal error, tag 6 status BAD code nil text No mailbox selected." |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
778 ;; Afterwards, everything seems to be fine. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
779 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
780 ;; * imaps works for local IMAP servers. Accessing |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
781 ;; "/imaps:imap.gmail.com:/INBOX.test/" results in error |
105766
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
782 ;; "error in process filter: Internal error, tag 5 status BAD code nil text UNSELECT not allowed now." |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
783 |
105779
4f83cd6cf378
* net/tramp-imap.el (top): Add `X-Size' to `imap-hash-headers'.
Michael Albinus <michael.albinus@gmx.de>
parents:
105766
diff
changeset
|
784 ;; * Improve `tramp-imap-handle-file-attributes' for directories. |
105766
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
785 |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
786 ;; * Saving a file creates a second one, instead of overwriting. |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
787 |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
788 ;; * Backup files: just *one* is kept. |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
789 |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
790 ;; * Password requests shall have a descriptive prompt. |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
791 |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
792 ;; * Exiting Emacs, there are running IMAP processes. Make them quiet |
bbf5bbea0d69
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Ignore
Michael Albinus <michael.albinus@gmx.de>
parents:
105377
diff
changeset
|
793 ;; by `set-process-query-on-exit-flag'. |
105250
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
794 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
795 (provide 'tramp-imap) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
796 ;;; tramp-imap.el ends here |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
797 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
798 ;; Ignore, for testing only. |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
799 |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
800 ;;; (setq tramp-imap-subject-marker "T") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
801 ;;; (tramp-imap-get-file-entries (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4") t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
802 ;;; (tramp-imap-get-file-entries (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/") t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
803 ;;; (tramp-imap-get-file-entries (tramp-dissect-file-name "/imap:yourhosthere.com:/test/4") t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
804 ;;; (tramp-imap-get-file-entries (tramp-dissect-file-name "/imap:yourhosthere.com:/test/") t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
805 ;;; (tramp-imap-get-file-entries (tramp-dissect-file-name "/imap:yourhosthere.com:/test/welcommen") t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
806 ;;; (tramp-imap-get-file-entries (tramp-dissect-file-name "/imap:yourhosthere.com:/test/welcommen") t t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
807 ;;;(tramp-imap-get-file-inode "/imap:yourhosthere.com:/test/welcome") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
808 ;;; (dired-copy-file "/etc/fstab" "/imap:yourhosthere.com:/test/welcome" t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
809 ;;; (write-region 1 100 "/imap:yourhosthere.com:/test/welcome") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
810 ;;; (tramp-imap-get-file "/imap:yourhosthere.com:/test/welcome" t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
811 ;;(with-temp-buffer (insert "hello") (write-file "/imap:yourhosthere.com:/test/welcome")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
812 ;;(with-temp-buffer (insert "hello") (write-file "/imap:yourhosthere.com:/test/welcome2")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
813 ;;(file-writable-p "/imap:yourhosthere.com:/test/welcome2") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
814 ;;(file-name-directory "/imap:yourhosthere.com:/test/welcome2") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
815 ;;(with-temp-buffer (insert "hello") (delete-file "/tmp/hellotest") (write-file "/tmp/hellotest") (write-file "/imap:yourhosthere.com:/test/welcome2")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
816 ;;;(file-exists-p "/imap:yourhosthere.com:/INBOX.test/4") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
817 ;;;(file-attributes "/imap:yourhosthere.com:/INBOX.test/4") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
818 ;;;(setq vec (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
819 ;;;(tramp-imap-handle-file-attributes "/imap:yourhosthere.com:/INBOX.test/4") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
820 ;;; (tramp-imap-handle-insert-file-contents "/imap:user@yourhosthere.com:/INBOX.test/4" nil nil nil nil) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
821 ;;;(insert-file-contents "/imap:yourhosthere.com:/INBOX.test/4") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
822 ;;;(file-attributes "/imap:yourhosthere.com:/test/welcommen") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
823 ;;;(insert-file-contents "/imap:yourhosthere.com:/test/welcome") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
824 ;;;(file-exists-p "/imap:yourhosthere.com:/test/welcome2") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
825 ;;;(tramp-imap-handle-file-attributes "/imap:yourhosthere.com:/test/welcome") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
826 ;;;(tramp-imap-get-file-inode "/imap:yourhosthere.com:/test/welcommen") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
827 ;;;(tramp-imap-get-file-inode "/imap:yourhosthere.com:/test/welcome") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
828 ;;;(file-writable-p "/imap:yourhosthere.com:/test/welcome2") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
829 ;;; (delete-file "/imap:yourhosthere.com:/test/welcome") |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
830 ;;; (tramp-imap-get-file "/imap:yourhosthere.com:/test/welcommen" t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
831 ;;; (tramp-imap-get-file "/imap:yourhosthere.com:/test/welcome" t) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
832 ;;;(tramp-imap-file-name-mailbox (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
833 ;;;(tramp-imap-file-name-mailbox (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/new/old")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
834 ;;;(tramp-imap-file-name-mailbox (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/new")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
835 ;;;(tramp-imap-file-name-parse (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/new/two")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
836 ;;;(tramp-imap-file-name-parse (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/new/one")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
837 ;;;(tramp-imap-file-name-parse (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
838 ;;; (tramp-imap-file-name-parse (tramp-dissect-file-name "/imap:yourhosthere.com:/test/4")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
839 ;;; (tramp-imap-file-name-parse (tramp-dissect-file-name "/imap:yourhosthere.com:/test/")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
840 ;;; (tramp-imap-file-name-parse (tramp-dissect-file-name "/imap:yourhosthere.com:/test/welcommen")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
841 ;;; (tramp-imap-file-name-parse (tramp-dissect-file-name "/imap:yourhosthere.com:/test/welcommen")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
842 ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/test/welcommen")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
843 ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4")) |
ceeb0491fbb4
* net/tramp-imap.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
844 ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4") "extra") |