aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2007-11-01 03:52:26 +0000
committerGlenn Morris2007-11-01 03:52:26 +0000
commit683b7dc6706c160b7cb1ca11800b470bd54b0c12 (patch)
treea27af5ec433a2f514a5f5bedb85fbd0c9ef3b0de
parent56dad874f3112244ffacf735703c8d763c1514c9 (diff)
downloademacs-683b7dc6706c160b7cb1ca11800b470bd54b0c12.tar.gz
emacs-683b7dc6706c160b7cb1ca11800b470bd54b0c12.zip
Ryan Yeske <rcyeske at gmail.com>
(rcirc-last-quit-line, rcirc-last-line) (rcirc-elapsed-lines): New argument PROCESS. Update callers. (rcirc-print): Only update the line count when not marking the line as ommittable. (rcirc-log-write): Specify coding system when writing logfile. (rcirc-markup-fill): Make sure ellipsis does not cause line to wrap.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/net/rcirc.el74
2 files changed, 45 insertions, 38 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7938ddebed9..1fb8408e4d0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -5,6 +5,15 @@
5 (footnote-roman-lower-regexp, footnote-roman-upper-regexp): 5 (footnote-roman-lower-regexp, footnote-roman-upper-regexp):
6 Match multi-character footnotes. 6 Match multi-character footnotes.
7 7
82007-11-01 Ryan Yeske <rcyeske@gmail.com>
9
10 * net/rcirc.el (rcirc-last-quit-line, rcirc-last-line)
11 (rcirc-elapsed-lines): New argument PROCESS. Update callers.
12 (rcirc-print): Only update the line count when not marking the
13 line as omittable.
14 (rcirc-log-write): Specify coding system when writing logfile.
15 (rcirc-markup-fill): Make sure ellipsis does not cause line to wrap.
16
82007-11-01 Dan Nicolaescu <dann@ics.uci.edu> 172007-11-01 Dan Nicolaescu <dann@ics.uci.edu>
9 18
10 * ediff-util.el (ediff-nuke-selective-display): Move definition to 19 * ediff-util.el (ediff-nuke-selective-display): Move definition to
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 7d22cda3e4d..ef24de44e50 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1308,29 +1308,29 @@ Logfiles are kept in `rcirc-log-directory'."
1308 :type 'integer 1308 :type 'integer
1309 :group 'rcirc) 1309 :group 'rcirc)
1310 1310
1311(defun rcirc-last-quit-line (nick target) 1311(defun rcirc-last-quit-line (process nick target)
1312 "Return the line number where NICK left TARGET. 1312 "Return the line number where NICK left TARGET.
1313Returns nil if the information is not recorded." 1313Returns nil if the information is not recorded."
1314 (let ((chanbuf (rcirc-get-buffer (rcirc-buffer-process) target))) 1314 (let ((chanbuf (rcirc-get-buffer process target)))
1315 (when chanbuf 1315 (when chanbuf
1316 (cdr (assoc-string nick (with-current-buffer chanbuf 1316 (cdr (assoc-string nick (with-current-buffer chanbuf
1317 rcirc-recent-quit-alist)))))) 1317 rcirc-recent-quit-alist))))))
1318 1318
1319(defun rcirc-last-line (nick target) 1319(defun rcirc-last-line (process nick target)
1320 "Return the line from the last activity from NICK in TARGET." 1320 "Return the line from the last activity from NICK in TARGET."
1321 (let* ((chanbuf (rcirc-get-buffer (rcirc-buffer-process) target)) 1321 (let* ((chanbuf (rcirc-get-buffer process target))
1322 (line (or (cdr (assoc-string target 1322 (line (or (cdr (assoc-string target
1323 (gethash nick (with-rcirc-server-buffer 1323 (gethash nick (with-rcirc-server-buffer
1324 rcirc-nick-table)) t)) 1324 rcirc-nick-table)) t))
1325 (rcirc-last-quit-line nick target)))) 1325 (rcirc-last-quit-line process nick target))))
1326 (if line 1326 (if line
1327 line 1327 line
1328 ;;(message "line is nil for %s in %s" nick target) 1328 ;;(message "line is nil for %s in %s" nick target)
1329 nil))) 1329 nil)))
1330 1330
1331(defun rcirc-elapsed-lines (nick target) 1331(defun rcirc-elapsed-lines (process nick target)
1332 "Return the number of lines since activity from NICK in TARGET." 1332 "Return the number of lines since activity from NICK in TARGET."
1333 (let ((last-activity-line (rcirc-last-line nick target))) 1333 (let ((last-activity-line (rcirc-last-line process nick target)))
1334 (when (and last-activity-line 1334 (when (and last-activity-line
1335 (> last-activity-line 0)) 1335 (> last-activity-line 0))
1336 (- rcirc-current-line last-activity-line)))) 1336 (- rcirc-current-line last-activity-line))))
@@ -1340,14 +1340,13 @@ Returns nil if the information is not recorded."
1340 rcirc-markup-my-nick 1340 rcirc-markup-my-nick
1341 rcirc-markup-urls 1341 rcirc-markup-urls
1342 rcirc-markup-keywords 1342 rcirc-markup-keywords
1343 rcirc-markup-bright-nicks 1343 rcirc-markup-bright-nicks)
1344 rcirc-markup-fill)
1345 1344
1346 "List of functions used to manipulate text before it is printed. 1345 "List of functions used to manipulate text before it is printed.
1347 1346
1348Each function takes two arguments, SENDER, RESPONSE. The buffer 1347Each function takes two arguments, SENDER, and RESPONSE. The
1349is narrowed with the text to be printed and the point is at the 1348buffer is narrowed with the text to be printed and the point is
1350beginning of the `rcirc-text' propertized text.") 1349at the beginning of the `rcirc-text' propertized text.")
1351 1350
1352(defun rcirc-print (process sender response target text &optional activity) 1351(defun rcirc-print (process sender response target text &optional activity)
1353 "Print TEXT in the buffer associated with TARGET. 1352 "Print TEXT in the buffer associated with TARGET.
@@ -1395,9 +1394,6 @@ record activity."
1395 'rcirc-text) 1394 'rcirc-text)
1396 rcirc-prompt-end-marker))) 1395 rcirc-prompt-end-marker)))
1397 1396
1398 ;; increment the line count
1399 (setq rcirc-current-line (1+ rcirc-current-line))
1400
1401 ;; run markup functions 1397 ;; run markup functions
1402 (save-excursion 1398 (save-excursion
1403 (save-restriction 1399 (save-restriction
@@ -1415,13 +1411,15 @@ record activity."
1415 (add-text-properties (point-min) (point-max) 1411 (add-text-properties (point-min) (point-max)
1416 '(read-only t front-sticky t)))) 1412 '(read-only t front-sticky t))))
1417 ;; make text omittable 1413 ;; make text omittable
1418 (let ((last-activity-lines (rcirc-elapsed-lines sender target))) 1414 (let ((last-activity-lines (rcirc-elapsed-lines process sender target)))
1419 (when (and (not (string= (rcirc-nick process) sender)) 1415 (if (and (not (string= (rcirc-nick process) sender))
1420 (member response rcirc-omit-responses) 1416 (member response rcirc-omit-responses)
1421 (or (not last-activity-lines) 1417 (or (not last-activity-lines)
1422 (< rcirc-omit-threshold last-activity-lines))) 1418 (< rcirc-omit-threshold last-activity-lines)))
1423 (put-text-property (1- start) (1- rcirc-prompt-start-marker) 1419 (put-text-property (1- start) (1- rcirc-prompt-start-marker)
1424 'invisible 'rcirc-omit))))) 1420 'invisible 'rcirc-omit)
1421 ;; otherwise increment the line count
1422 (setq rcirc-current-line (1+ rcirc-current-line))))))
1425 1423
1426 (set-marker-insertion-type rcirc-prompt-start-marker nil) 1424 (set-marker-insertion-type rcirc-prompt-start-marker nil)
1427 (set-marker-insertion-type rcirc-prompt-end-marker nil) 1425 (set-marker-insertion-type rcirc-prompt-end-marker nil)
@@ -1504,9 +1502,10 @@ Log data is written to `rcirc-log-directory'."
1504 (dolist (cell rcirc-log-alist) 1502 (dolist (cell rcirc-log-alist)
1505 (with-temp-buffer 1503 (with-temp-buffer
1506 (insert (cdr cell)) 1504 (insert (cdr cell))
1507 (write-region (point-min) (point-max) 1505 (let ((coding-system-for-write 'utf-8))
1508 (concat rcirc-log-directory "/" (car cell)) 1506 (write-region (point-min) (point-max)
1509 t 'quiet))) 1507 (concat rcirc-log-directory "/" (car cell))
1508 t 'quiet))))
1510 (setq rcirc-log-alist nil)) 1509 (setq rcirc-log-alist nil))
1511 1510
1512(defun rcirc-join-channels (process channels) 1511(defun rcirc-join-channels (process channels)
@@ -1538,7 +1537,6 @@ Update the associated linestamp if LINE is non-nil.
1538 1537
1539If the record doesn't exist, and LINE is nil, set the linestamp 1538If the record doesn't exist, and LINE is nil, set the linestamp
1540to zero." 1539to zero."
1541 ;;(message "rcirc-put-nick-channel: %S %S %S" nick channel line)
1542 (let ((nick (rcirc-user-nick nick))) 1540 (let ((nick (rcirc-user-nick nick)))
1543 (with-rcirc-process-buffer process 1541 (with-rcirc-process-buffer process
1544 (let* ((chans (gethash nick rcirc-nick-table)) 1542 (let* ((chans (gethash nick rcirc-nick-table))
@@ -2240,11 +2238,13 @@ keywords when no KEYWORD is given."
2240 (let ((fill-prefix 2238 (let ((fill-prefix
2241 (or rcirc-fill-prefix 2239 (or rcirc-fill-prefix
2242 (make-string (- (point) (line-beginning-position)) ?\s))) 2240 (make-string (- (point) (line-beginning-position)) ?\s)))
2243 (fill-column (cond ((eq rcirc-fill-column 'frame-width) 2241 (fill-column (- (cond ((eq rcirc-fill-column 'frame-width)
2244 (1- (frame-width))) 2242 (1- (frame-width)))
2245 (rcirc-fill-column 2243 (rcirc-fill-column
2246 rcirc-fill-column) 2244 rcirc-fill-column)
2247 (t fill-column)))) 2245 (t fill-column))
2246 ;; make sure ... doesn't cause line wrapping
2247 3)))
2248 (fill-region (point) (point-max) nil t)))) 2248 (fill-region (point) (point-max) nil t))))
2249 2249
2250;;; handlers 2250;;; handlers
@@ -2254,7 +2254,6 @@ keywords when no KEYWORD is given."
2254;; verbatim 2254;; verbatim
2255(defun rcirc-handler-001 (process sender args text) 2255(defun rcirc-handler-001 (process sender args text)
2256 (rcirc-handler-generic process "001" sender args text) 2256 (rcirc-handler-generic process "001" sender args text)
2257 ;; set the real server name
2258 (with-rcirc-process-buffer process 2257 (with-rcirc-process-buffer process
2259 (setq rcirc-connecting nil) 2258 (setq rcirc-connecting nil)
2260 (rcirc-reschedule-timeout process) 2259 (rcirc-reschedule-timeout process)
@@ -2303,10 +2302,10 @@ keywords when no KEYWORD is given."
2303 ;; when recently rejoining, restore the linestamp 2302 ;; when recently rejoining, restore the linestamp
2304 (rcirc-put-nick-channel process sender channel 2303 (rcirc-put-nick-channel process sender channel
2305 (let ((last-activity-lines 2304 (let ((last-activity-lines
2306 (rcirc-elapsed-lines sender channel))) 2305 (rcirc-elapsed-lines process sender channel)))
2307 (when (and last-activity-lines 2306 (when (and last-activity-lines
2308 (< last-activity-lines rcirc-omit-threshold)) 2307 (< last-activity-lines rcirc-omit-threshold))
2309 (rcirc-last-line sender channel))))) 2308 (rcirc-last-line process sender channel)))))
2310 2309
2311 (rcirc-print process sender "JOIN" channel "") 2310 (rcirc-print process sender "JOIN" channel "")
2312 2311
@@ -2357,15 +2356,14 @@ keywords when no KEYWORD is given."
2357 2356
2358(defun rcirc-maybe-remember-nick-quit (process nick channel) 2357(defun rcirc-maybe-remember-nick-quit (process nick channel)
2359 "Remember NICK as leaving CHANNEL if they recently spoke." 2358 "Remember NICK as leaving CHANNEL if they recently spoke."
2360 (let ((elapsed-lines (rcirc-elapsed-lines nick channel))) 2359 (let ((elapsed-lines (rcirc-elapsed-lines process nick channel)))
2361 (when (and elapsed-lines 2360 (when (and elapsed-lines
2362 (< elapsed-lines rcirc-omit-threshold)) 2361 (< elapsed-lines rcirc-omit-threshold))
2363 (let ((buffer (rcirc-get-buffer process channel))) 2362 (let ((buffer (rcirc-get-buffer process channel)))
2364 (when buffer 2363 (when buffer
2365 (with-current-buffer buffer 2364 (with-current-buffer buffer
2366 (let ((record (assoc-string nick rcirc-recent-quit-alist 2365 (let ((record (assoc-string nick rcirc-recent-quit-alist t))
2367 t)) 2366 (line (rcirc-last-line process nick channel)))
2368 (line (rcirc-last-line nick channel)))
2369 (if record 2367 (if record
2370 (setcdr record line) 2368 (setcdr record line)
2371 (setq rcirc-recent-quit-alist 2369 (setq rcirc-recent-quit-alist