Mercurial > emacs
annotate lisp/url/url-irc.el @ 68866:5340157fbfc2
* files.el (safe-local-variable-values): New option.
(hack-local-variables-prop-line): Return a list of variable-value
pairs if MODE-ONLY is non-nil.
(hack-local-variables): Construct list of variable-value pairs,
and apply or reject them in one go. Ask for confirmation if
variables are not known safe.
(hack-local-variables-confirm): Complete rewrite. Support
`safe-local-variable-values'.
(enable-local-variables): Update docstring to reflect new
behavior.
(ignored-local-variables): Ignore ignored-local-variables and
safe-local-variable-values.
(safe-local-variable-p): New function.
(risky-local-variable-p): `safe-local-variable' property check
moved to safe-local-variable-p.
(hack-one-local-variable): Checks moved to hack-local-variables.
(byte-compile-dynamic, c-basic-offset, c-file-style,
c-indent-level, comment-column, fill-column, fill-prefix,
indent-tabs-mode, kept-new-versions, no-byte-compile,
no-update-autoloads, outline-regexp, page-delimiter,
paragraph-start, paragraph-separate, sentence-end,
sentence-end-double-space tab-width, version-control): Add
`safe-local-variable' property.
* find-lisp.el: Delete nonexistent `autocompile' file variable.
* icomplete.el, play/landmark.el: Change nonexistent
`outline-layout' file variable to `allout-layout'.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Tue, 14 Feb 2006 01:21:31 +0000 |
parents | e8a3fb527b77 |
children | 20c95c0b0947 d04d8ccb3c41 |
rev | line source |
---|---|
54695 | 1 ;;; url-irc.el --- IRC URL interface |
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, 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. | |
54695 | 14 |
57612 | 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 ;;; Commentary: | |
26 | |
27 ;; IRC URLs are defined in http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt | |
28 | |
29 ;;; Code: | |
54695 | 30 |
31 (require 'url-vars) | |
32 (require 'url-parse) | |
33 | |
34 (defconst url-irc-default-port 6667 "Default port for IRC connections") | |
35 | |
36 (defcustom url-irc-function 'url-irc-zenirc | |
37 "*Function to actually open an IRC connection. | |
38 Should be a function that takes several argument: | |
39 HOST - the hostname of the IRC server to contact | |
40 PORT - the port number of the IRC server to contact | |
41 CHANNEL - What channel on the server to visit right away (can be nil) | |
42 USER - What username to use | |
43 PASSWORD - What password to use" | |
44 :type '(choice (const :tag "ZEN IRC" :value 'url-irc-zenirc) | |
45 (function :tag "Other")) | |
46 :group 'url) | |
47 | |
48 (defun url-irc-zenirc (host port channel user password) | |
49 (let ((zenirc-buffer-name (if (and user host port) | |
50 (format "%s@%s:%d" user host port) | |
51 (format "%s:%d" host port))) | |
52 (zenirc-server-alist | |
53 (list | |
54 (list host port password nil user)))) | |
55 (zenirc) | |
56 (goto-char (point-max)) | |
57 (if (not channel) | |
58 nil | |
59 (insert "/join " channel) | |
60 (zenirc-send-line)))) | |
61 | |
62 ;;;###autoload | |
63 (defun url-irc (url) | |
64 (let* ((host (url-host url)) | |
57886
60d07d8a52e1
* url-imap.el (url-imap-open-host): Don't use
Masatake YAMATO <jet@gyve.org>
parents:
57612
diff
changeset
|
65 (port (url-port url)) |
54695 | 66 (pass (url-password url)) |
67 (user (url-user url)) | |
68 (chan (url-filename url))) | |
69 (if (url-target url) | |
70 (setq chan (concat chan "#" (url-target url)))) | |
71 (if (string-match "^/" chan) | |
72 (setq chan (substring chan 1 nil))) | |
73 (if (= (length chan) 0) | |
74 (setq chan nil)) | |
75 (funcall url-irc-function host port chan user pass) | |
76 nil)) | |
77 | |
78 (provide 'url-irc) | |
54699 | 79 |
80 ;;; arch-tag: 2e5eecf8-9eb3-436b-9fbd-c26f2fb2bf3e | |
57612 | 81 ;;; url-irc.el ends here |