Mercurial > emacs
annotate lisp/url/url-misc.el @ 73269:aeb79612dc36
Merge from gnus--rel--5.10
Patches applied:
* gnus--rel--5.10 (patch 145-148)
- Merge from emacs--devo--0
- Update from CVS
2006-10-04 Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Clarify
gnus-summary-limit-to-articles.
2006-10-04 Romain Francoise <romain@orebokech.com>
* lisp/gnus/gnus-util.el (gnus-alist-to-hashtable, gnus-hashtable-to-alist):
Moved here (and renamed) from gnus-registry.el.
* lisp/gnus/gnus-registry.el: Require gnus-util.
Use `gnus-alist-to-hashtable' and `gnus-hashtable-to-alist'.
2006-10-04 Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/pop3.el (pop3-authentication-scheme): Clarify doc.
(pop3-movemail): Warn about pop3-leave-mail-on-server.
2006-10-04 Dave Love <fx@gnu.org>
* lisp/gnus/pop3.el (pop3-authentication-scheme): Add custom version.
2006-10-04 Jesper Harder <harder@ifa.au.dk>
* lisp/gnus/pop3.el (pop3-leave-mail-on-server): Don't quote nil in
doc string. Improve doc string.
2006-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-util.el (gnus-with-local-quit): New macro.
* lisp/gnus/gnus-demon.el (gnus-demon): Replace with-local-quit with it.
2006-10-06 Reiner Steib <Reiner.Steib@gmx.de>
* man/gnus.texi (Image Enhancements): Update for Emacs 22.
* man/gnus-faq.texi ([1.3]): Update.
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-466
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 07 Oct 2006 01:51:54 +0000 |
parents | e8a3fb527b77 |
children | e3694f1cb928 d04d8ccb3c41 |
rev | line source |
---|---|
54695 | 1 ;;; url-misc.el --- Misc Uniform Resource Locator retrieval code |
57612 | 2 |
64748
875dcc490074
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64084
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2002, 2004, |
68640
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64748
diff
changeset
|
4 ;; 2005, 2006 Free Software Foundation, Inc. |
57612 | 5 |
54695 | 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. | |
19 | |
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 ;;; Code: | |
54695 | 26 |
57512
44bc5df842b7
Load cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
57427
diff
changeset
|
27 (eval-when-compile (require 'cl)) |
54695 | 28 (require 'url-vars) |
29 (require 'url-parse) | |
30 (autoload 'Info-goto-node "info" "" t) | |
31 (autoload 'man "man" nil t) | |
32 | |
33 ;;;###autoload | |
34 (defun url-man (url) | |
35 "Fetch a Unix manual page URL." | |
36 (man (url-filename url)) | |
37 nil) | |
38 | |
39 ;;;###autoload | |
40 (defun url-info (url) | |
41 "Fetch a GNU Info URL." | |
42 ;; Fetch an info node | |
43 (let* ((fname (url-filename url)) | |
44 (node (url-unhex-string (or (url-target url) "Top")))) | |
45 (if (and fname node) | |
46 (Info-goto-node (concat "(" fname ")" node)) | |
47 (error "Malformed url: %s" (url-recreate-url url))) | |
48 nil)) | |
49 | |
50 (defun url-do-terminal-emulator (type server port user) | |
51 (terminal-emulator | |
52 (generate-new-buffer (format "%s%s" (if user (concat user "@") "") server)) | |
53 (case type | |
54 (rlogin "rlogin") | |
55 (telnet "telnet") | |
56 (tn3270 "tn3270") | |
57 (otherwise | |
58 (error "Unknown terminal emulator required: %s" type))) | |
59 (case type | |
60 (rlogin | |
61 (if user | |
62 (list server "-l" user) | |
63 (list server))) | |
64 (telnet | |
65 (if user (message "Please log in as user: %s" user)) | |
66 (if port | |
67 (list server port) | |
68 (list server))) | |
69 (tn3270 | |
70 (if user (message "Please log in as user: %s" user)) | |
71 (list server))))) | |
72 | |
73 ;;;###autoload | |
74 (defun url-generic-emulator-loader (url) | |
75 (let* ((type (intern (downcase (url-type url)))) | |
76 (server (url-host url)) | |
77 (name (url-user url)) | |
78 (port (url-port url))) | |
79 (url-do-terminal-emulator type server port name)) | |
80 nil) | |
81 | |
82 ;;;###autoload | |
83 (defalias 'url-rlogin 'url-generic-emulator-loader) | |
84 ;;;###autoload | |
85 (defalias 'url-telnet 'url-generic-emulator-loader) | |
86 ;;;###autoload | |
87 (defalias 'url-tn3270 'url-generic-emulator-loader) | |
88 | |
89 ;; RFC 2397 | |
90 ;;;###autoload | |
91 (defun url-data (url) | |
92 "Fetch a data URL (RFC 2397)." | |
93 (let ((mediatype nil) | |
94 ;; The mediatype may need to be hex-encoded too -- see the RFC. | |
95 (desc (url-unhex-string (url-filename url))) | |
96 (encoding "8bit") | |
97 (data nil)) | |
98 (save-excursion | |
99 (if (not (string-match "\\([^,]*\\)?," desc)) | |
100 (error "Malformed data URL: %s" desc) | |
101 (setq mediatype (match-string 1 desc)) | |
102 (if (and mediatype (string-match ";base64\\'" mediatype)) | |
103 (setq mediatype (substring mediatype 0 (match-beginning 0)) | |
104 encoding "base64")) | |
105 (if (or (null mediatype) | |
106 (eq ?\; (aref mediatype 0))) | |
107 (setq mediatype (concat "text/plain" mediatype))) | |
108 (setq data (url-unhex-string (substring desc (match-end 0))))) | |
109 (set-buffer (generate-new-buffer " *url-data*")) | |
110 (mm-disable-multibyte) | |
111 (insert (format "Content-Length: %d\n" (length data)) | |
112 "Content-Type: " mediatype "\n" | |
113 "Content-Encoding: " encoding "\n" | |
114 "\n") | |
115 (if data (insert data)) | |
116 (current-buffer)))) | |
117 | |
118 (provide 'url-misc) | |
54699 | 119 |
120 ;;; arch-tag: 8c544e1b-d8bc-40a6-b319-f1f37fef65a0 | |
57612 | 121 ;;; url-misc.el ends here |