Show
Ignore:
Timestamp:
09/09/06 16:30:10 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/net/rcirc.el

    r4098 r4161  
    4040;; Open a new irc connection with: 
    4141;; M-x irc RET 
     42 
     43;;; Todo: 
    4244 
    4345;;; Code: 
     
    139141  :type '(choice (const :tag "No truncation" nil) 
    140142                 (integer :tag "Number of lines")) 
     143  :group 'rcirc) 
     144 
     145(defcustom rcirc-show-maximum-output t 
     146  "*If non-nil, scroll buffer to keep the point at the bottom of 
     147the window." 
     148  :type 'boolean 
    141149  :group 'rcirc) 
    142150 
     
    195203  :group 'rcirc) 
    196204 
     205(defcustom rcirc-keywords nil 
     206  "List of keywords to highlight in message text." 
     207  :type '(repeat string) 
     208  :group 'rcirc) 
     209 
    197210(defcustom rcirc-ignore-list () 
    198211  "List of ignored nicks. 
     
    207220parts.") 
    208221 
    209 (defcustom rcirc-bright-nick-regexp nil 
    210   "Regexp matching nicks to be emphasized. 
     222(defcustom rcirc-bright-nicks nil 
     223  "List of nicks to be emphasized. 
    211224See `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. 
     225  :type '(repeat string) 
     226  :group 'rcirc) 
     227 
     228(defcustom rcirc-dim-nicks nil 
     229  "List of nicks to be deemphasized. 
    217230See `rcirc-dim-nick' face." 
    218   :type 'regexp 
     231  :type '(repeat string) 
    219232  :group 'rcirc) 
    220233 
     
    241254 
    242255(defcustom rcirc-coding-system-alist nil 
    243   "Alist to decide a coding system to use for a file I/O operation. 
     256  "Alist to decide a coding system to use for a channel I/O operation. 
    244257The format is ((PATTERN . VAL) ...). 
    245258PATTERN is either a string or a cons of strings. 
     
    298311(defvar rcirc-urls nil 
    299312  "List of urls seen in the current buffer.") 
     313(put 'rcirc-urls 'permanent-local t) 
    300314 
    301315(defvar rcirc-keepalive-seconds 60 
     
    522536    (message "UNHANDLED: %s" text))) 
    523537 
    524 (defun rcirc-handler-generic (process command sender args text) 
     538(defvar rcirc-responses-no-activity '("305" "306") 
     539  "Responses that don't trigger activity in the mode-line indicator.") 
     540 
     541(defun rcirc-handler-generic (process response sender args text) 
    525542  "Generic server response handler." 
    526   (rcirc-print process sender command nil 
    527                (mapconcat 'identity (cdr args) " ") t)) 
     543  (rcirc-print process sender response nil 
     544               (mapconcat 'identity (cdr args) " ") 
     545               (not (member response rcirc-responses-no-activity)))) 
    528546 
    529547(defun rcirc-send-string (process string) 
     
    540558  "Return the process associated with channel BUFFER. 
    541559With no argument or nil as argument, use the current buffer." 
    542   (get-buffer-process (or buffer rcirc-server-buffer))) 
     560  (get-buffer-process (if buffer 
     561                          (with-current-buffer buffer 
     562                            rcirc-server-buffer) 
     563                        rcirc-server-buffer))) 
    543564 
    544565(defun rcirc-server-name (process) 
     
    602623(defvar rcirc-nick-completions nil) 
    603624(defvar rcirc-nick-completion-start-offset nil) 
     625 
    604626(defun rcirc-complete-nick () 
    605627  "Cycle through nick completions from list of nicks in channel." 
    606628  (interactive) 
    607   (if (eq last-command 'rcirc-complete-nick
     629  (if (eq last-command this-command
    608630      (setq rcirc-nick-completions 
    609631            (append (cdr rcirc-nick-completions) 
     
    627649  (let ((completion (car rcirc-nick-completions))) 
    628650    (when completion 
     651      (rcirc-put-nick-channel (rcirc-buffer-process) completion rcirc-target) 
    629652      (delete-region (+ rcirc-prompt-end-marker 
    630                         rcirc-nick-completion-start-offset) 
    631                      (point)) 
     653                       rcirc-nick-completion-start-offset) 
     654                    (point)) 
    632655      (insert (concat completion 
    633656                      (if (= (+ rcirc-prompt-end-marker 
     
    710733  (setq rcirc-short-buffer-name nil) 
    711734  (make-local-variable 'rcirc-urls) 
    712   (setq rcirc-urls nil) 
    713735  (setq use-hard-newlines t) 
    714736 
     
    738760  ;; if the user changes the major mode or kills the buffer, there is 
    739761  ;; cleanup work to do 
    740   (make-local-variable 'change-major-mode-hook
    741   (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook
    742   (make-local-variable 'kill-buffer-hook) 
    743   (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook
     762  (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t
     763  (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook nil t
     764 
     765  (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom nil t
    744766 
    745767  ;; add to buffer list, and update buffer abbrevs 
     
    928950            (funcall fun args process rcirc-target) 
    929951          (rcirc-send-string process 
    930                              (concat command " " args))))))) 
     952                             (concat command " :" args))))))) 
    931953 
    932954(defvar rcirc-parent-buffer nil) 
     
    10601082                  ((or (eq key ?n) (eq key ?N)) 
    10611083                   ;; %n/%N -- nick 
    1062                    (let ((nick (concat (if (string= (with-rcirc-process-buffer process 
     1084                   (let ((nick (concat (if (string= (with-rcirc-process-buffer  
     1085                                                        process 
    10631086                                                      rcirc-server) 
    10641087                                                    sender) 
     
    10711094                                     (cond ((string= sender (rcirc-nick process)) 
    10721095                                            'rcirc-my-nick) 
    1073                                            ((and rcirc-bright-nick-regexp 
    1074                                                  (string-match rcirc-bright-nick-regexp sender)) 
     1096                                           ((and rcirc-bright-nicks 
     1097                                                 (string-match  
     1098                                                  (regexp-opt rcirc-bright-nicks) 
     1099                                                  sender)) 
    10751100                                            'rcirc-bright-nick) 
    1076                                            ((and rcirc-dim-nick-regexp 
    1077                                                  (string-match rcirc-dim-nick-regexp sender)) 
     1101                                           ((and rcirc-dim-nicks 
     1102                                                 (string-match 
     1103                                                  (regexp-opt rcirc-dim-nicks) 
     1104                                                  sender)) 
    10781105                                            'rcirc-dim-nick) 
    10791106                                           (t 
    10801107                                            'rcirc-other-nick)))))) 
    1081                   ((eq key ?T) 
     1108                  ((eq key ?T) 
    10821109                   ;; %T -- timestamp 
    10831110                   (rcirc-facify 
     
    10861113                  ((eq key ?m) 
    10871114                   ;; %m -- message text 
    1088                    ;; We add the text property `rcirc-text' to identify this 
    1089                    ;; as the body text. 
    1090                    (propertize 
    1091                     (rcirc-mangle-text process (rcirc-facify text face)) 
    1092                     'rcirc-text text)) 
     1115                   (rcirc-markup-text process sender response (rcirc-facify text face))) 
    10931116                  ((eq key ?t) 
    10941117                   ;; %t -- target 
     
    11391162               (rcirc-any-buffer process)))))) 
    11401163 
    1141 (defvar rcirc-activity-type nil) 
    1142 (make-variable-buffer-local 'rcirc-activity-type
     1164(defvar rcirc-activity-types nil) 
     1165(make-variable-buffer-local 'rcirc-activity-types
    11431166(defvar rcirc-last-sender nil) 
    11441167(make-variable-buffer-local 'rcirc-last-sender) 
    1145 (defvar rcirc-gray-toggle nil) 
    1146 (make-variable-buffer-local 'rcirc-gray-toggle) 
     1168 
     1169(defun rcirc-scroll-to-bottom (window display-start) 
     1170  "Scroll window to show maximum output if `rcirc-show-maximum-output' is 
     1171non-nil." 
     1172  (when rcirc-show-maximum-output 
     1173    (with-selected-window window 
     1174      (when (>= (window-point) rcirc-prompt-end-marker) 
     1175        (recenter -1))))) 
     1176 
    11471177(defun rcirc-print (process sender response target text &optional activity) 
    11481178  "Print TEXT in the buffer associated with TARGET. 
     
    12391269 
    12401270        ;; record modeline activity 
    1241         (when activity 
    1242           (let ((nick-match 
    1243                  (string-match (concat "\\b" 
    1244                                        (regexp-quote (rcirc-nick process)) 
    1245                                        "\\b") 
    1246                                text))) 
    1247             (when (if rcirc-ignore-buffer-activity-flag 
    1248                       ;; - Always notice when our nick is mentioned 
    1249                       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)))) 
    1253               (rcirc-record-activity 
    1254                (current-buffer) 
    1255                (when (or nick-match (and (not (rcirc-channel-p rcirc-target)) 
    1256                                          (not rcirc-low-priority-flag))) 
    1257                  'nick))))) 
     1271        (when (and activity 
     1272                   (not rcirc-ignore-buffer-activity-flag) 
     1273                   (not (and rcirc-dim-nicks sender 
     1274                             (string-match (regexp-opt rcirc-dim-nicks) sender)))) 
     1275              (rcirc-record-activity (current-buffer) 
     1276                                     (when (not (rcirc-channel-p rcirc-target)) 
     1277                                       'nick))) 
    12581278 
    12591279        (sit-for 0)                     ; displayed text before hook 
     
    14761496                          (t2 (with-current-buffer b2 rcirc-last-post-time))) 
    14771497                      (time-less-p t2 t1))))) 
    1478       (if (not rcirc-activity-type) 
    1479           (setq rcirc-activity-type type)) 
     1498      (pushnew type rcirc-activity-types) 
    14801499      (rcirc-update-activity-string))) 
    14811500  (run-hook-with-args 'rcirc-activity-hooks buffer)) 
     
    14851504  (setq rcirc-activity (delete buffer rcirc-activity)) 
    14861505  (with-current-buffer buffer 
    1487     (setq rcirc-activity-type nil))) 
     1506    (setq rcirc-activity-types nil))) 
    14881507 
    14891508(defun rcirc-split-activity (activity) 
     
    14931512      (with-current-buffer buf 
    14941513        (if (and rcirc-low-priority-flag 
    1495                  (not (eq rcirc-activity-type 'nick))) 
     1514                 (not (member 'nick rcirc-activity-types))) 
    14961515            (add-to-list 'lopri buf t) 
    14971516          (add-to-list 'hipri buf t)))) 
     
    15051524         (hipri (cdr pair))) 
    15061525    (setq rcirc-activity-string 
    1507           (if (or hipri lopri) 
    1508               (concat "-" 
    1509                       (and hipri "[") 
    1510                       (rcirc-activity-string hipri) 
    1511                       (and hipri lopri ",") 
    1512                       (and lopri 
    1513                            (concat "(" 
    1514                                    (rcirc-activity-string lopri) 
    1515                                    ")")) 
    1516                       (and hipri "]") 
    1517                       "-") 
    1518             "-[]-")))) 
     1526          (cond ((or hipri lopri) 
     1527                 (concat "-" 
     1528                         (and hipri "[") 
     1529                         (rcirc-activity-string hipri) 
     1530                         (and hipri lopri ",") 
     1531                         (and lopri 
     1532                              (concat "(" 
     1533                                      (rcirc-activity-string lopri) 
     1534                                      ")")) 
     1535                         (and hipri "]") 
     1536                         "-")) 
     1537                ((not (null (rcirc-process-list))) 
     1538                 "-[]-") 
     1539                (t ""))))) 
    15191540 
    15201541(defun rcirc-activity-string (buffers) 
    15211542  (mapconcat (lambda (b) 
    1522                (let ((s (rcirc-short-buffer-name b))) 
     1543               (let ((s (substring-no-properties (rcirc-short-buffer-name b)))) 
    15231544                 (with-current-buffer b 
    1524                    (if (not (eq rcirc-activity-type 'nick)) 
    1525                        s 
    1526                      (rcirc-facify s 'rcirc-mode-line-nick))))) 
     1545                   (dolist (type rcirc-activity-types) 
     1546                     (rcirc-add-face 0 (length s) 
     1547                                     (case type 
     1548                                       (nick 'rcirc-track-nick) 
     1549                                       (keyword 'rcirc-track-keyword)) 
     1550                                     s))) 
     1551                 s)) 
    15271552             buffers ",")) 
    15281553 
     
    15391564    (walk-windows (lambda (w) 
    15401565                    (let ((buf (window-buffer w))) 
    1541                       (when (eq major-mode 'rcirc-mode) 
    1542                         (rcirc-clear-activity buf) 
     1566                      (with-current-buffer buf 
     1567                        (when (eq major-mode 'rcirc-mode) 
     1568                          (rcirc-clear-activity buf))) 
    15431569                        (when (eq buf rcirc-current-buffer) 
    1544                           (setq current-now-hidden nil)))))) 
     1570                          (setq current-now-hidden nil))))) 
    15451571    ;; add overlay arrow if the buffer isn't displayed 
    1546     (when (and rcirc-current-buffer current-now-hidden) 
     1572    (when (and current-now-hidden 
     1573               rcirc-current-buffer 
     1574               (buffer-live-p rcirc-current-buffer)) 
    15471575      (with-current-buffer rcirc-current-buffer 
    1548         (when (eq major-mode 'rcirc-mode) 
    1549           (marker-position overlay-arrow-position
     1576        (when (and (eq major-mode 'rcirc-mode) 
     1577                  (marker-position overlay-arrow-position)
    15501578          (set-marker overlay-arrow-position nil))))) 
    15511579 
     
    17651793                                     target args))) 
    17661794 
     1795(defun rcirc-add-or-remove (set &optional elt) 
     1796  (if (and elt (not (string= "" elt))) 
     1797      (if (member-ignore-case elt set) 
     1798          (delete elt set) 
     1799        (cons elt set)) 
     1800    set)) 
     1801 
    17671802(defun-rcirc-command ignore (nick) 
    17681803  "Manage the ignore list. 
     
    17711806ones added to the list automatically are marked with an asterisk." 
    17721807  (interactive "sToggle ignoring of nick: ") 
    1773   (when (not (string= "" nick)) 
    1774     (if (member nick rcirc-ignore-list) 
    1775         (setq rcirc-ignore-list (delete nick rcirc-ignore-list)) 
    1776       (setq rcirc-ignore-list (cons nick rcirc-ignore-list)))) 
    1777   (rcirc-print process (rcirc-nick process) "IGNORE" target  
     1808  (setq rcirc-ignore-list (rcirc-add-or-remove rcirc-ignore-list nick)) 
     1809  (rcirc-print process nil "IGNORE" target  
    17781810               (mapconcat 
    17791811                (lambda (nick) 
     
    17831815                rcirc-ignore-list " "))) 
    17841816 
     1817(defun-rcirc-command bright (nick) 
     1818  "Manage the bright nick list." 
     1819  (interactive "sToggle emphasis of nick: ") 
     1820  (setq rcirc-bright-nicks (rcirc-add-or-remove rcirc-bright-nicks nick)) 
     1821  (rcirc-print process nil "BRIGHT" target  
     1822               (mapconcat 'identity rcirc-bright-nicks " "))) 
     1823 
     1824(defun-rcirc-command dim (nick) 
     1825  "Manage the dim nick list." 
     1826  (interactive "sToggle deemphasis of nick: ") 
     1827  (setq rcirc-dim-nicks (rcirc-add-or-remove rcirc-dim-nicks nick)) 
     1828  (rcirc-print process nil "DIM" target  
     1829               (mapconcat 'identity rcirc-dim-nicks " "))) 
     1830 
     1831(defun-rcirc-command keyword (keyword) 
     1832  "Manage the keyword list. 
     1833Mark KEYWORD, unmark KEYWORD if already marked, or list marked 
     1834keywords when no KEYWORD is given." 
     1835  (interactive "sToggle highlighting of keyword: ") 
     1836  (setq rcirc-keywords (rcirc-add-or-remove rcirc-keywords keyword)) 
     1837  (rcirc-print process nil "KEYWORD" target  
     1838               (mapconcat 'identity rcirc-keywords " "))) 
     1839 
    17851840  
    1786 (defun rcirc-message-leader (sender face) 
    1787   "Return a string with SENDER propertized with FACE." 
    1788   (rcirc-facify (concat "<" sender "> ") face)) 
     1841(defun rcirc-add-face (start end name &optional object) 
     1842  "Add face NAME to the face text property of the text from START to END." 
     1843  (when name 
     1844    (let ((pos start) 
     1845          next prop) 
     1846      (while (< pos end) 
     1847        (setq prop (get-text-property pos 'face object) 
     1848              next (next-single-property-change pos 'face object end)) 
     1849        (unless (member name (get-text-property pos 'face object)) 
     1850          (add-text-properties pos next (list 'face (cons name prop)) object)) 
     1851        (setq pos next))))) 
    17891852 
    17901853(defun rcirc-facify (string face) 
    17911854  "Return a copy of STRING with FACE property added." 
    1792   (propertize (or string "") 'face face 'rear-nonsticky t)) 
     1855  (let ((string (or string ""))) 
     1856    (rcirc-add-face 0 (length string) face string) 
     1857    string)) 
    17931858 
    17941859(defvar rcirc-url-regexp 
     
    18011866                  "www.") 
    18021867              (1+ (char "-a-zA-Z0-9_.")) 
     1868              (1+ (char "-a-zA-Z0-9_")) 
    18031869              (optional ":" (1+ (char "0-9")))) 
    18041870             (and (1+ (char "-a-zA-Z0-9_.")) 
     
    18071873         (optional  
    18081874          (and "/" 
    1809                (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]")) 
    1810                (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]"))))) 
     1875               (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]()")) 
     1876               (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]()"))))) 
    18111877  "Regexp matching URLs.  Set to nil to disable URL features in rcirc.") 
    18121878 
     
    18241890  "Send URL at point to `browse-url'." 
    18251891  (interactive "d") 
    1826   (let ((beg (previous-single-property-change point 'mouse-face)) 
     1892  (let ((beg (previous-single-property-change (1+ point) 'mouse-face)) 
    18271893        (end (next-single-property-change point 'mouse-face))) 
    18281894    (browse-url (buffer-substring-no-properties beg end)))) 
     
    18351901      (rcirc-browse-url-at-point (posn-point position))))) 
    18361902 
    1837 (defun rcirc-map-regexp (function regexp string) 
    1838   "Return a copy of STRING after calling FUNCTION for each REGEXP match. 
    1839 FUNCTION takes 3 arguments, MATCH-START, MATCH-END, and STRING." 
    1840   (let ((start 0)) 
    1841     (while (string-match regexp string start) 
    1842       (setq start (match-end 0)) 
    1843       (funcall function (match-beginning 0) (match-end 0) string))) 
    1844   string) 
    1845  
    1846 (defun rcirc-mangle-text (process text) 
     1903  
     1904(defvar rcirc-markup-text-functions 
     1905  '(rcirc-markup-body-text 
     1906    rcirc-markup-attributes 
     1907    rcirc-markup-my-nick 
     1908    rcirc-markup-urls 
     1909    rcirc-markup-keywords 
     1910    rcirc-markup-bright-nicks) 
     1911  "List of functions used to manipulate text before it is printed. 
     1912 
     1913Each function takes three arguments, PROCESS, SENDER, RESPONSE 
     1914and CHANNEL-BUFFER.  The current buffer is temporary buffer that 
     1915contains the text to manipulate.  Each function works on the text 
     1916in this buffer.") 
     1917 
     1918(defun rcirc-markup-text (process sender response text) 
    18471919  "Return TEXT with properties added based on various patterns." 
    1848   ;; ^B 
    1849   (setq text 
    1850         (rcirc-map-regexp 
    1851          (lambda (start end string) 
    1852            (let ((orig-face (get-text-property start 'face string))) 
    1853                (add-text-properties 
    1854                 start end 
    1855                 (list 'face (if (listp orig-face) 
    1856                                 (append orig-face 
    1857                                         (list 'bold)) 
    1858                               (list orig-face 'bold)) 
    1859                       'rear-nonsticky t) 
    1860                 string))) 
    1861            ".*?" 
    1862            text)) 
    1863   ;; TODO: deal with ^_ and ^C colors sequences 
    1864   (while (string-match "\\(.*\\)[]\\(.*\\)" text) 
    1865     (setq text (concat (match-string 1 text) 
    1866                        (match-string 2 text)))) 
    1867   ;; my nick 
    1868   (setq text 
    1869         (with-syntax-table rcirc-nick-syntax-table 
    1870           (rcirc-map-regexp (lambda (start end string) 
    1871                               (add-text-properties 
    1872                                start end 
    1873                                (list 'face 'rcirc-nick-in-message 
    1874                                      'rear-nonsticky t) 
    1875                                string)) 
    1876                             (concat "\\b" 
    1877                                     (regexp-quote (rcirc-nick process)) 
    1878                                     "\\b") 
    1879                             text))) 
    1880   ;; urls 
    1881   (setq text 
    1882         (rcirc-map-regexp 
    1883          (lambda (start end string) 
    1884            (let ((orig-face (get-text-property start 'face string))) 
    1885              (add-text-properties start end 
    1886                                   (list 'face (if (listp orig-face) 
    1887                                                   (append orig-face 
    1888                                                           (list 'bold)) 
    1889                                                 (list orig-face 'bold)) 
    1890                                         'rear-nonsticky t 
    1891                                         'mouse-face 'highlight 
    1892                                         'keymap rcirc-browse-url-map) 
    1893                                   string)) 
    1894              (push (substring-no-properties string start end) rcirc-urls)) 
    1895            rcirc-url-regexp 
    1896            text)) 
    1897   text) 
    1898  
     1920  (let ((channel-buffer (current-buffer))) 
     1921    (with-temp-buffer 
     1922      (insert text) 
     1923      (goto-char (point-min)) 
     1924      (dolist (fn rcirc-markup-text-functions) 
     1925        (save-excursion 
     1926          (funcall fn process sender response channel-buffer))) 
     1927      (buffer-substring (point-min) (point-max))))) 
     1928 
     1929(defun rcirc-markup-body-text (process sender response channel-buffer) 
     1930  ;; We add the text property `rcirc-text' to identify this as the 
     1931  ;; body text. 
     1932  (add-text-properties (point-min) (point-max) 
     1933                       (list 'rcirc-text (buffer-substring-no-properties 
     1934                                          (point-min) (point-max))))) 
     1935 
     1936(defun rcirc-markup-attributes (process sender response channel-buffer) 
     1937  (while (re-search-forward "\\([\C-b\C-_\C-v]\\).*?\\(\\1\\|\C-o\\)" nil t) 
     1938    (rcirc-add-face (match-beginning 0) (match-end 0) 
     1939                    (case (char-after (match-beginning 1)) 
     1940                      (?\C-b 'bold) 
     1941                      (?\C-v 'italic) 
     1942                      (?\C-_ 'underline))) 
     1943    ;; keep the ^O since it could terminate other attributes 
     1944    (when (not (eq ?\C-o (char-before (match-end 2)))) 
     1945      (delete-region (match-beginning 2) (match-end 2))) 
     1946    (delete-region (match-beginning 1) (match-end 1)) 
     1947    (goto-char (1+ (match-beginning 1)))) 
     1948  ;; remove the ^O characters now 
     1949  (while (re-search-forward "\C-o+" nil t) 
     1950    (delete-region (match-beginning 0) (match-end 0)))) 
     1951 
     1952(defun rcirc-markup-my-nick (process sender response channel-buffer) 
     1953  (with-syntax-table rcirc-nick-syntax-table 
     1954    (while (re-search-forward (concat "\\b"  
     1955                                      (regexp-quote (rcirc-nick process)) 
     1956                                      "\\b") 
     1957                              nil t) 
     1958      (rcirc-add-face (match-beginning 0) (match-end 0)  
     1959                      'rcirc-nick-in-message) 
     1960      (when (string= response "PRIVMSG") 
     1961        (rcirc-add-face (point-min) (point-max) 'rcirc-nick-in-message-full-line) 
     1962        (rcirc-record-activity channel-buffer 'nick))))) 
     1963 
     1964(defun rcirc-markup-urls (process sender response channel-buffer) 
     1965  (while (re-search-forward rcirc-url-regexp nil t) 
     1966    (let ((start (match-beginning 0)) 
     1967          (end (match-end 0))) 
     1968      (rcirc-add-face start end 'rcirc-url) 
     1969      (add-text-properties start end (list 'mouse-face 'highlight 
     1970                                           'keymap rcirc-browse-url-map)) 
     1971      ;; record the url 
     1972      (let ((url (buffer-substring-no-properties start end))) 
     1973        (with-current-buffer channel-buffer 
     1974          (push url rcirc-urls)))))) 
     1975 
     1976(defun rcirc-markup-keywords (process sender response channel-buffer) 
     1977  (let* ((target (with-current-buffer channel-buffer (or rcirc-target ""))) 
     1978         (keywords (delq nil (mapcar (lambda (keyword) 
     1979                                      (when (not (string-match keyword target)) 
     1980                                        keyword)) 
     1981                                    rcirc-keywords)))) 
     1982    (when keywords 
     1983      (while (re-search-forward (regexp-opt keywords 'words) nil t) 
     1984        (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword) 
     1985        (when (and (string= response "PRIVMSG") 
     1986                   (not (string= sender (rcirc-nick process)))) 
     1987          (rcirc-record-activity channel-buffer 'keyword)))))) 
     1988 
     1989(defun rcirc-markup-bright-nicks (process sender response channel-buffer) 
     1990  (when (and rcirc-bright-nicks 
     1991             (string= response "NAMES")) 
     1992    (with-syntax-table rcirc-nick-syntax-table 
     1993      (while (re-search-forward (regexp-opt rcirc-bright-nicks 'words) nil t) 
     1994        (rcirc-add-face (match-beginning 0) (match-end 0) 
     1995                        'rcirc-bright-nick))))) 
    18991996  
    19001997;;; handlers 
     
    22472344    (((class color) (min-colors 8)) (:foreground "magenta")) 
    22482345    (t (:weight bold :underline t))) 
    2249   "Face used for nicks matched by `rcirc-bright-nick-regexp'." 
     2346  "Face used for nicks matched by `rcirc-bright-nicks'." 
    22502347  :group 'rcirc-faces) 
    22512348 
    22522349(defface rcirc-dim-nick 
    22532350  '((t :inherit default)) 
    2254   "Face used for nicks matched by `rcirc-dim-nick-regexp'." 
     2351  "Face used for nicks in `rcirc-dim-nicks'." 
    22552352  :group 'rcirc-faces) 
    22562353 
     
    23012398    (((class color) (min-colors 8)) (:foreground "cyan" :weight bold)) 
    23022399    (t (:weight bold))) 
    2303   "The face used to highlight instances of nick within messages." 
     2400  "The face used to highlight instances of your nick within messages." 
    23042401  :group 'rcirc-faces) 
     2402 
     2403(defface rcirc-nick-in-message-full-line 
     2404  '((t (:bold t))) 
     2405  "The face used emphasize the entire message when your nick is mentioned." 
     2406  :group 'rcirc-faces)   
    23052407 
    23062408(defface rcirc-prompt                   ; comint-highlight-prompt 
     
    23112413  :group 'rcirc-faces) 
    23122414 
    2313 (defface rcirc-mode-line-nick 
     2415(defface rcirc-track-nick 
     2416  '((t (:inverse-video t))) 
     2417  "The face used in the mode-line when your nick is mentioned." 
     2418  :group 'rcirc-faces) 
     2419 
     2420(defface rcirc-track-keyword 
     2421  '((t (:bold t ))) 
     2422  "The face used in the mode-line when keywords are mentioned." 
     2423  :group 'rcirc-faces) 
     2424 
     2425(defface rcirc-url 
    23142426  '((t (:bold t))) 
    2315   "The face used indicate activity directed at you." 
     2427  "The face used to highlight urls." 
     2428  :group 'rcirc-faces) 
     2429 
     2430(defface rcirc-keyword 
     2431  '((t (:inherit highlight))) 
     2432  "The face used to highlight keywords." 
    23162433  :group 'rcirc-faces) 
    23172434