Mercurial > emacs
annotate lisp/url/url-imap.el @ 67715:69a961190da1
(Qmac_apple_event): Add extern.
(set_frame_menubar, mac_menu_show keymp_panes)
(single_keymap_panes, list_of_panes, list_of_item)
(single_menu_item): Add argument types to prototypes.
(mac_dialog_show) [HAVE_DIALOGS]: Likewise.
(struct skp): New struct (from xmenu.c).
(single_keymap_panes, single_menu_item, list_of_panes)
(list_of_item): Sync with xmenu.c.
(Fx_popup_menu, Fx_popup_dialog): Likewise. Don't get window from
POSITION if it is mac-apple-event event.
(menubar_selection_callback): Don't use menu_command_in_progress.
(set_frame_menubar): First parse all submenus, then make
widget_value trees from them. Don't allocate any widget_value
objects until we are done with the parsing.
(parse_single_submenu, digest_single_submenu): New functions.
(single_submenu): Function deleted, replaced by those two.
(install_menu_quit_handler) [HAVE_CANCELMENUTRACKING]: Don't
create or dispose of EventHandlerUPP. Install hander to all submenus.
(mac_menu_show) [!HAVE_MULTILINGUAL_MENU]: Use ENCODE_MENU_STRING
instead of ENCODE_SYSTEM.
(free_frame_menubar, fill_submenu, fill_menu): Don't use NULL for
integer values.
[HAVE_DIALOGS] (mac_dialog_show): Sync with xdialog_show (in xmenu.c).
(add_menu_item) [TARGET_API_MAC_CARBON]: Use CFString functions to
format menu item string. Don't use NULL for integer value.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Wed, 21 Dec 2005 12:31:02 +0000 |
parents | 875dcc490074 |
children | e8a3fb527b77 532e0a9335a9 |
rev | line source |
---|---|
54695 | 1 ;;; url-imap.el --- IMAP retrieval routines |
57612 | 2 |
64748
875dcc490074
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64084
diff
changeset
|
3 ;; Copyright (C) 1999, 2004, 2005 Free Software Foundation, Inc. |
57612 | 4 |
54695 | 5 ;; Author: Simon Josefsson <jas@pdc.kth.se> |
6 ;; Keywords: comm, data, processes | |
7 | |
57612 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
54695 | 19 |
57612 | 20 ;; You should have received a copy of the GNU General Public License |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64084 | 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 ;; Boston, MA 02110-1301, USA. | |
57612 | 24 |
25 ;;; Commentary: | |
54695 | 26 |
57612 | 27 ;; Anyway, here's a teaser. It's quite broken in lots of regards, but at |
28 ;; least it seem to work. At least a little. At least when called | |
29 ;; manually like this (I've no idea how it's supposed to be called): | |
30 | |
31 ;; (url-imap (url-generic-parse-url "imap://cyrus.andrew.cmu.edu/archive.c-client;UID=1021")) | |
32 | |
33 ;;; Code: | |
54695 | 34 |
35 (eval-when-compile (require 'cl)) | |
36 (require 'url-util) | |
37 (require 'url-parse) | |
38 (require 'nnimap) | |
39 (require 'mm-util) | |
40 | |
41 (defconst url-imap-default-port 143 "Default IMAP port") | |
42 | |
43 (defun url-imap-open-host (host port user pass) | |
44 ;; xxx use user and password | |
45 (if (fboundp 'nnheader-init-server-buffer) | |
46 (nnheader-init-server-buffer)) | |
47 (let ((imap-username user) | |
48 (imap-password pass) | |
49 (authenticator (if user 'login 'anonymous))) | |
50 (nnimap-open-server host | |
51 `((nnimap-server-port ,port) | |
52 (nnimap-stream 'network) | |
53 (nnimap-authenticator ,authenticator))))) | |
54 | |
55 (defun url-imap (url) | |
56 (check-type url vector "Need a pre-parsed URL.") | |
57 (save-excursion | |
58 (set-buffer (generate-new-buffer " *url-imap*")) | |
59 (mm-disable-multibyte) | |
60 (let* ((host (url-host url)) | |
61 (port (url-port url)) | |
62 ;; xxx decode mailbox (see rfc2192) | |
63 (mailbox (url-filename url)) | |
64 (coding-system-for-read 'binary)) | |
65 (and (eq (string-to-char mailbox) ?/) | |
66 (setq mailbox (substring mailbox 1))) | |
67 (url-imap-open-host host port (url-user url) (url-password url)) | |
68 (cond ((assoc "TYPE" (url-attributes url)) | |
69 ;; xxx list mailboxes (start gnus?) | |
70 ) | |
71 ((assoc "UID" (url-attributes url)) | |
72 ;; fetch message part | |
73 ;; xxx handle partial fetches | |
74 (insert "Content-type: message/rfc822\n\n") | |
75 (nnimap-request-article (cdr (assoc "UID" (url-attributes url))) | |
76 mailbox host (current-buffer))) | |
77 (t | |
78 ;; xxx list messages in mailbox (start gnus?) | |
79 ))) | |
80 (current-buffer))) | |
54699 | 81 |
82 ;;; arch-tag: 034991ff-5425-48ea-b911-c96c90e6f47d | |
57612 | 83 ;;; url-imap.el ends here |