Mercurial > emacs
diff 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 |
line wrap: on
line diff
--- a/lisp/net/rcirc.el Thu Apr 20 16:09:11 2006 +0000 +++ b/lisp/net/rcirc.el Fri Apr 28 14:48:18 2006 +0000 @@ -74,13 +74,13 @@ :group 'rcirc) (defcustom rcirc-default-user-full-name (if (string= (user-full-name) "") - rcirc-user-name - (user-full-name)) + rcirc-user-name + (user-full-name)) "The full name sent to the server when connecting." :type 'string :group 'rcirc) -(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#emacs")) +(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#rcirc")) "Alist of channels to join at startup. Each element looks like (SERVER-REGEXP . CHANNEL-LIST)." :type '(alist :key-type string :value-type (repeat string)) @@ -206,6 +206,18 @@ Nicks will be removed from the automatic list on follow-up renamings or parts.") +(defcustom rcirc-bright-nick-regexp nil + "Regexp matching nicks to be emphasized. +See `rcirc-bright-nick' face." + :type 'regexp + :group 'rcirc) + +(defcustom rcirc-dim-nick-regexp nil + "Regexp matching nicks to be deemphasized. +See `rcirc-dim-nick' face." + :type 'regexp + :group 'rcirc) + (defcustom rcirc-print-hooks nil "Hook run after text is printed. Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT." @@ -217,7 +229,7 @@ :type 'boolean :group 'rcirc) -(defcustom rcirc-decode-coding-system 'undecided +(defcustom rcirc-decode-coding-system 'utf-8 "Coding system used to decode incoming irc messages." :type 'coding-system :group 'rcirc) @@ -546,7 +558,7 @@ (with-current-buffer rcirc-server-buffer (or rcirc-nick rcirc-default-nick)))) -(defvar rcirc-max-message-length 450 +(defvar rcirc-max-message-length 420 "Messages longer than this value will be split.") (defun rcirc-send-message (process target message &optional noticep) @@ -955,7 +967,8 @@ :global nil :group 'rcirc (make-local-variable 'rcirc-parent-buffer) - (put 'rcirc-parent-buffer 'permanent-local t)) + (put 'rcirc-parent-buffer 'permanent-local t) + (setq fill-column rcirc-max-message-length)) (defun rcirc-multiline-minor-submit () "Send the text in buffer back to parent buffer." @@ -1029,6 +1042,7 @@ (split-string (or (cdr (assoc response rcirc-response-formats)) (cdr (assq t rcirc-response-formats))) "%")) + (sender (or sender "")) (result "") (face nil) key face-key repl) @@ -1054,9 +1068,16 @@ (rcirc-facify nick (if (eq key ?n) face - (if (string= sender (rcirc-nick process)) - 'rcirc-my-nick - 'rcirc-other-nick))))) + (cond ((string= sender (rcirc-nick process)) + 'rcirc-my-nick) + ((and rcirc-bright-nick-regexp + (string-match rcirc-bright-nick-regexp sender)) + 'rcirc-bright-nick) + ((and rcirc-dim-nick-regexp + (string-match rcirc-dim-nick-regexp sender)) + 'rcirc-dim-nick) + (t + 'rcirc-other-nick)))))) ((eq key ?T) ;; %T -- timestamp (rcirc-facify @@ -1130,8 +1151,9 @@ (or text (setq text "")) (unless (or (member sender rcirc-ignore-list) (member (with-syntax-table rcirc-nick-syntax-table - (when (string-match "^\\([^/]\\w*\\)\\b" text) - (match-string 1 text))) rcirc-ignore-list)) + (when (string-match "^\\([^/]\\w*\\)[:,]" text) + (match-string 1 text))) + rcirc-ignore-list)) (let* ((buffer (rcirc-target-buffer process sender response target text)) (inhibit-read-only t)) (with-current-buffer buffer @@ -1222,10 +1244,12 @@ (regexp-quote (rcirc-nick process)) "\\b") text))) - (when (or (not rcirc-ignore-buffer-activity-flag) - ;; always notice when our nick is mentioned, even - ;; if ignoring channel activity - nick-match) + (when (if rcirc-ignore-buffer-activity-flag + ;; - Always notice when our nick is mentioned + nick-match + ;; - Never bother us if a dim-nick spoke + (not (and rcirc-dim-nick-regexp sender + (string-match rcirc-dim-nick-regexp sender)))) (rcirc-record-activity (current-buffer) (when (or nick-match (and (not (rcirc-channel-p rcirc-target)) @@ -1375,7 +1399,7 @@ (force-mode-line-update)) (defun rcirc-toggle-low-priority () - "Toggle the value of `rcirc-ignore-buffer-activity-flag'." + "Toggle the value of `rcirc-low-priority-flag'." (interactive) (setq rcirc-low-priority-flag (not rcirc-low-priority-flag)) @@ -1788,7 +1812,7 @@ (defun rcirc-browse-url (&optional arg) "Prompt for URL to browse based on URLs in buffer." - (interactive) + (interactive "P") (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls)) (initial-input (car rcirc-urls)) (history (cdr rcirc-urls))) @@ -1910,7 +1934,7 @@ (cond ((rcirc-channel-p target) target) ;;; -ChanServ- [#gnu] Welcome... - ((string-match "^\\[\\(#[^ ]+\\)\\]" message) + ((string-match "\\[\\(#[^\] ]+\\)\\]" message) (match-string 1 message)) (sender (if (string= sender (rcirc-server-name process)) @@ -2211,6 +2235,25 @@ "The face used to highlight other messages." :group 'rcirc-faces) +(defface rcirc-bright-nick + '((((class grayscale) (background light)) + (:foreground "LightGray" :weight bold :underline t)) + (((class grayscale) (background dark)) + (:foreground "Gray50" :weight bold :underline t)) + (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue")) + (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine")) + (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue")) + (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine")) + (((class color) (min-colors 8)) (:foreground "magenta")) + (t (:weight bold :underline t))) + "Face used for nicks matched by `rcirc-bright-nick-regexp'." + :group 'rcirc-faces) + +(defface rcirc-dim-nick + '((t :inherit default)) + "Face used for nicks matched by `rcirc-dim-nick-regexp'." + :group 'rcirc-faces) + (defface rcirc-server ; font-lock-comment-face '((((class grayscale) (background light)) (:foreground "DimGray" :weight bold :slant italic))