comparison lisp/net/rcirc.el @ 83513:966a40e7fb54

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-234 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-235 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-236 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-237 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-238 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-239 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-240 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-241 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-242 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-243 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-244 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-245 (Ffield_beginning, find_field): Undo change of 2006-04-23. * emacs@sv.gnu.org/emacs--devo--0--patch-246 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-247 Rcirc patch from Ryan Yeske * emacs@sv.gnu.org/emacs--devo--0--patch-248 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-249 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-250 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-251 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-87 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-88 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-89 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-90 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-91 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-92 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-93 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-94 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-95 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-553
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 28 Apr 2006 14:48:18 +0000
parents 81f2d90dee68 90d76f24753a
children a387c138b28e
comparison
equal deleted inserted replaced
83512:5d328dadd0f4 83513:966a40e7fb54
72 "Your user name sent to the server when connecting." 72 "Your user name sent to the server when connecting."
73 :type 'string 73 :type 'string
74 :group 'rcirc) 74 :group 'rcirc)
75 75
76 (defcustom rcirc-default-user-full-name (if (string= (user-full-name) "") 76 (defcustom rcirc-default-user-full-name (if (string= (user-full-name) "")
77 rcirc-user-name 77 rcirc-user-name
78 (user-full-name)) 78 (user-full-name))
79 "The full name sent to the server when connecting." 79 "The full name sent to the server when connecting."
80 :type 'string 80 :type 'string
81 :group 'rcirc) 81 :group 'rcirc)
82 82
83 (defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#emacs")) 83 (defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#rcirc"))
84 "Alist of channels to join at startup. 84 "Alist of channels to join at startup.
85 Each element looks like (SERVER-REGEXP . CHANNEL-LIST)." 85 Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
86 :type '(alist :key-type string :value-type (repeat string)) 86 :type '(alist :key-type string :value-type (repeat string))
87 :group 'rcirc) 87 :group 'rcirc)
88 88
204 "List of ignored nicks added to `rcirc-ignore-list' because of renaming. 204 "List of ignored nicks added to `rcirc-ignore-list' because of renaming.
205 When an ignored person renames, their nick is added to both lists. 205 When an ignored person renames, their nick is added to both lists.
206 Nicks will be removed from the automatic list on follow-up renamings or 206 Nicks will be removed from the automatic list on follow-up renamings or
207 parts.") 207 parts.")
208 208
209 (defcustom rcirc-bright-nick-regexp nil
210 "Regexp matching nicks to be emphasized.
211 See `rcirc-bright-nick' face."
212 :type 'regexp
213 :group 'rcirc)
214
215 (defcustom rcirc-dim-nick-regexp nil
216 "Regexp matching nicks to be deemphasized.
217 See `rcirc-dim-nick' face."
218 :type 'regexp
219 :group 'rcirc)
220
209 (defcustom rcirc-print-hooks nil 221 (defcustom rcirc-print-hooks nil
210 "Hook run after text is printed. 222 "Hook run after text is printed.
211 Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT." 223 Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
212 :type 'hook 224 :type 'hook
213 :group 'rcirc) 225 :group 'rcirc)
215 (defcustom rcirc-always-use-server-buffer-flag nil 227 (defcustom rcirc-always-use-server-buffer-flag nil
216 "Non-nil means messages without a channel target will go to the server buffer." 228 "Non-nil means messages without a channel target will go to the server buffer."
217 :type 'boolean 229 :type 'boolean
218 :group 'rcirc) 230 :group 'rcirc)
219 231
220 (defcustom rcirc-decode-coding-system 'undecided 232 (defcustom rcirc-decode-coding-system 'utf-8
221 "Coding system used to decode incoming irc messages." 233 "Coding system used to decode incoming irc messages."
222 :type 'coding-system 234 :type 'coding-system
223 :group 'rcirc) 235 :group 'rcirc)
224 236
225 (defcustom rcirc-encode-coding-system 'utf-8 237 (defcustom rcirc-encode-coding-system 'utf-8
544 With no argument or nil as argument, use the current buffer." 556 With no argument or nil as argument, use the current buffer."
545 (with-current-buffer (or buffer (current-buffer)) 557 (with-current-buffer (or buffer (current-buffer))
546 (with-current-buffer rcirc-server-buffer 558 (with-current-buffer rcirc-server-buffer
547 (or rcirc-nick rcirc-default-nick)))) 559 (or rcirc-nick rcirc-default-nick))))
548 560
549 (defvar rcirc-max-message-length 450 561 (defvar rcirc-max-message-length 420
550 "Messages longer than this value will be split.") 562 "Messages longer than this value will be split.")
551 563
552 (defun rcirc-send-message (process target message &optional noticep) 564 (defun rcirc-send-message (process target message &optional noticep)
553 "Send TARGET associated with PROCESS a privmsg with text MESSAGE. 565 "Send TARGET associated with PROCESS a privmsg with text MESSAGE.
554 If NOTICEP is non-nil, send a notice instead of privmsg." 566 If NOTICEP is non-nil, send a notice instead of privmsg."
953 :lighter " rcirc-mline" 965 :lighter " rcirc-mline"
954 :keymap rcirc-multiline-minor-mode-map 966 :keymap rcirc-multiline-minor-mode-map
955 :global nil 967 :global nil
956 :group 'rcirc 968 :group 'rcirc
957 (make-local-variable 'rcirc-parent-buffer) 969 (make-local-variable 'rcirc-parent-buffer)
958 (put 'rcirc-parent-buffer 'permanent-local t)) 970 (put 'rcirc-parent-buffer 'permanent-local t)
971 (setq fill-column rcirc-max-message-length))
959 972
960 (defun rcirc-multiline-minor-submit () 973 (defun rcirc-multiline-minor-submit ()
961 "Send the text in buffer back to parent buffer." 974 "Send the text in buffer back to parent buffer."
962 (interactive) 975 (interactive)
963 (assert rcirc-parent-buffer) 976 (assert rcirc-parent-buffer)
1027 is found by looking up RESPONSE in `rcirc-response-formats'." 1040 is found by looking up RESPONSE in `rcirc-response-formats'."
1028 (let ((chunks 1041 (let ((chunks
1029 (split-string (or (cdr (assoc response rcirc-response-formats)) 1042 (split-string (or (cdr (assoc response rcirc-response-formats))
1030 (cdr (assq t rcirc-response-formats))) 1043 (cdr (assq t rcirc-response-formats)))
1031 "%")) 1044 "%"))
1045 (sender (or sender ""))
1032 (result "") 1046 (result "")
1033 (face nil) 1047 (face nil)
1034 key face-key repl) 1048 key face-key repl)
1035 (when (equal (car chunks) "") 1049 (when (equal (car chunks) "")
1036 (pop chunks)) 1050 (pop chunks))
1052 sender) 1066 sender)
1053 (and target (concat "," target))))) 1067 (and target (concat "," target)))))
1054 (rcirc-facify nick 1068 (rcirc-facify nick
1055 (if (eq key ?n) 1069 (if (eq key ?n)
1056 face 1070 face
1057 (if (string= sender (rcirc-nick process)) 1071 (cond ((string= sender (rcirc-nick process))
1058 'rcirc-my-nick 1072 'rcirc-my-nick)
1059 'rcirc-other-nick))))) 1073 ((and rcirc-bright-nick-regexp
1074 (string-match rcirc-bright-nick-regexp sender))
1075 'rcirc-bright-nick)
1076 ((and rcirc-dim-nick-regexp
1077 (string-match rcirc-dim-nick-regexp sender))
1078 'rcirc-dim-nick)
1079 (t
1080 'rcirc-other-nick))))))
1060 ((eq key ?T) 1081 ((eq key ?T)
1061 ;; %T -- timestamp 1082 ;; %T -- timestamp
1062 (rcirc-facify 1083 (rcirc-facify
1063 (format-time-string rcirc-time-format (current-time)) 1084 (format-time-string rcirc-time-format (current-time))
1064 'rcirc-timestamp)) 1085 'rcirc-timestamp))
1128 Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, 1149 Format based on SENDER and RESPONSE. If ACTIVITY is non-nil,
1129 record activity." 1150 record activity."
1130 (or text (setq text "")) 1151 (or text (setq text ""))
1131 (unless (or (member sender rcirc-ignore-list) 1152 (unless (or (member sender rcirc-ignore-list)
1132 (member (with-syntax-table rcirc-nick-syntax-table 1153 (member (with-syntax-table rcirc-nick-syntax-table
1133 (when (string-match "^\\([^/]\\w*\\)\\b" text) 1154 (when (string-match "^\\([^/]\\w*\\)[:,]" text)
1134 (match-string 1 text))) rcirc-ignore-list)) 1155 (match-string 1 text)))
1156 rcirc-ignore-list))
1135 (let* ((buffer (rcirc-target-buffer process sender response target text)) 1157 (let* ((buffer (rcirc-target-buffer process sender response target text))
1136 (inhibit-read-only t)) 1158 (inhibit-read-only t))
1137 (with-current-buffer buffer 1159 (with-current-buffer buffer
1138 (let ((moving (= (point) rcirc-prompt-end-marker)) 1160 (let ((moving (= (point) rcirc-prompt-end-marker))
1139 (old-point (point-marker)) 1161 (old-point (point-marker))
1220 (let ((nick-match 1242 (let ((nick-match
1221 (string-match (concat "\\b" 1243 (string-match (concat "\\b"
1222 (regexp-quote (rcirc-nick process)) 1244 (regexp-quote (rcirc-nick process))
1223 "\\b") 1245 "\\b")
1224 text))) 1246 text)))
1225 (when (or (not rcirc-ignore-buffer-activity-flag) 1247 (when (if rcirc-ignore-buffer-activity-flag
1226 ;; always notice when our nick is mentioned, even 1248 ;; - Always notice when our nick is mentioned
1227 ;; if ignoring channel activity 1249 nick-match
1228 nick-match) 1250 ;; - Never bother us if a dim-nick spoke
1251 (not (and rcirc-dim-nick-regexp sender
1252 (string-match rcirc-dim-nick-regexp sender))))
1229 (rcirc-record-activity 1253 (rcirc-record-activity
1230 (current-buffer) 1254 (current-buffer)
1231 (when (or nick-match (and (not (rcirc-channel-p rcirc-target)) 1255 (when (or nick-match (and (not (rcirc-channel-p rcirc-target))
1232 (not rcirc-low-priority-flag))) 1256 (not rcirc-low-priority-flag)))
1233 'nick))))) 1257 'nick)))))
1373 "Ignore activity in this buffer" 1397 "Ignore activity in this buffer"
1374 "Notice activity in this buffer")) 1398 "Notice activity in this buffer"))
1375 (force-mode-line-update)) 1399 (force-mode-line-update))
1376 1400
1377 (defun rcirc-toggle-low-priority () 1401 (defun rcirc-toggle-low-priority ()
1378 "Toggle the value of `rcirc-ignore-buffer-activity-flag'." 1402 "Toggle the value of `rcirc-low-priority-flag'."
1379 (interactive) 1403 (interactive)
1380 (setq rcirc-low-priority-flag 1404 (setq rcirc-low-priority-flag
1381 (not rcirc-low-priority-flag)) 1405 (not rcirc-low-priority-flag))
1382 (message (if rcirc-low-priority-flag 1406 (message (if rcirc-low-priority-flag
1383 "Activity in this buffer is low priority" 1407 "Activity in this buffer is low priority"
1786 (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]"))))) 1810 (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]")))))
1787 "Regexp matching URLs. Set to nil to disable URL features in rcirc.") 1811 "Regexp matching URLs. Set to nil to disable URL features in rcirc.")
1788 1812
1789 (defun rcirc-browse-url (&optional arg) 1813 (defun rcirc-browse-url (&optional arg)
1790 "Prompt for URL to browse based on URLs in buffer." 1814 "Prompt for URL to browse based on URLs in buffer."
1791 (interactive) 1815 (interactive "P")
1792 (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls)) 1816 (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls))
1793 (initial-input (car rcirc-urls)) 1817 (initial-input (car rcirc-urls))
1794 (history (cdr rcirc-urls))) 1818 (history (cdr rcirc-urls)))
1795 (browse-url (completing-read "rcirc browse-url: " 1819 (browse-url (completing-read "rcirc browse-url: "
1796 completions nil nil initial-input 'history) 1820 completions nil nil initial-input 'history)
1908 (match-string 1 message)) 1932 (match-string 1 message))
1909 (rcirc-print process sender "NOTICE" 1933 (rcirc-print process sender "NOTICE"
1910 (cond ((rcirc-channel-p target) 1934 (cond ((rcirc-channel-p target)
1911 target) 1935 target)
1912 ;;; -ChanServ- [#gnu] Welcome... 1936 ;;; -ChanServ- [#gnu] Welcome...
1913 ((string-match "^\\[\\(#[^ ]+\\)\\]" message) 1937 ((string-match "\\[\\(#[^\] ]+\\)\\]" message)
1914 (match-string 1 message)) 1938 (match-string 1 message))
1915 (sender 1939 (sender
1916 (if (string= sender (rcirc-server-name process)) 1940 (if (string= sender (rcirc-server-name process))
1917 nil ; server notice 1941 nil ; server notice
1918 sender))) 1942 sender)))
2209 (((class color) (min-colors 8)) (:foreground "yellow" :weight light)) 2233 (((class color) (min-colors 8)) (:foreground "yellow" :weight light))
2210 (t (:weight bold :slant italic))) 2234 (t (:weight bold :slant italic)))
2211 "The face used to highlight other messages." 2235 "The face used to highlight other messages."
2212 :group 'rcirc-faces) 2236 :group 'rcirc-faces)
2213 2237
2238 (defface rcirc-bright-nick
2239 '((((class grayscale) (background light))
2240 (:foreground "LightGray" :weight bold :underline t))
2241 (((class grayscale) (background dark))
2242 (:foreground "Gray50" :weight bold :underline t))
2243 (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
2244 (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
2245 (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
2246 (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
2247 (((class color) (min-colors 8)) (:foreground "magenta"))
2248 (t (:weight bold :underline t)))
2249 "Face used for nicks matched by `rcirc-bright-nick-regexp'."
2250 :group 'rcirc-faces)
2251
2252 (defface rcirc-dim-nick
2253 '((t :inherit default))
2254 "Face used for nicks matched by `rcirc-dim-nick-regexp'."
2255 :group 'rcirc-faces)
2256
2214 (defface rcirc-server ; font-lock-comment-face 2257 (defface rcirc-server ; font-lock-comment-face
2215 '((((class grayscale) (background light)) 2258 '((((class grayscale) (background light))
2216 (:foreground "DimGray" :weight bold :slant italic)) 2259 (:foreground "DimGray" :weight bold :slant italic))
2217 (((class grayscale) (background dark)) 2260 (((class grayscale) (background dark))
2218 (:foreground "LightGray" :weight bold :slant italic)) 2261 (:foreground "LightGray" :weight bold :slant italic))