emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/rcirc-update 608b2ec 3/3: Replace with-current-buffer with buffe


From: Philip Kaludercic
Subject: feature/rcirc-update 608b2ec 3/3: Replace with-current-buffer with buffer-local-value where applicable
Date: Sat, 4 Sep 2021 19:40:12 -0400 (EDT)

branch: feature/rcirc-update
commit 608b2ec9be2a4c388341ac33f0a7b59bdcca2a2c
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Replace with-current-buffer with buffer-local-value where applicable
    
    * rcirc.el (rcirc-buffer-process): Use buffer-local-value
    (rcirc-last-quit-line): Use buffer-local-value
    (rcirc-bury-buffers): Use buffer-local-value
    (rcirc-record-activity): Use buffer-local-value
---
 lisp/net/rcirc.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 1770859..e4649a6 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1056,7 +1056,7 @@ With no argument or nil as argument, use the current 
buffer."
   (let ((buffer (or buffer (and (buffer-live-p rcirc-server-buffer)
                                rcirc-server-buffer))))
     (if buffer
-        (with-current-buffer buffer rcirc-process)
+        (buffer-local-value 'rcirc-process buffer)
       rcirc-process)))
 
 (defun rcirc-server-name (process)
@@ -1744,8 +1744,9 @@ Returns nil if the information is not recorded.
 PROCESS is the process object for the current connection."
   (let ((chanbuf (rcirc-get-buffer process target)))
     (when chanbuf
-      (cdr (assoc-string nick (with-current-buffer chanbuf
-                               rcirc-recent-quit-alist))))))
+      (cdr (assoc-string nick (buffer-local-value
+                               'rcirc-recent-quit-alist
+                               chanbuf))))))
 
 (defun rcirc-last-line (process nick target)
   "Return the line from the last activity from NICK in TARGET.
@@ -2183,7 +2184,7 @@ This function does not alter the INPUT string."
   "Bury all RCIRC buffers."
   (interactive)
   (dolist (buf (buffer-list))
-    (when (eq 'rcirc-mode (with-current-buffer buf major-mode))
+    (when (eq 'rcirc-mode (buffer-local-value 'major-mode buf))
       (bury-buffer buf)         ; buffers not shown
       (quit-windows-on buf))))  ; buffers shown in a window
 
@@ -2228,8 +2229,8 @@ activity.  Only run if the buffer is not visible and
              (sort (if (memq (current-buffer) rcirc-activity) rcirc-activity
                       (cons (current-buffer) rcirc-activity))
                    (lambda (b1 b2)
-                     (let ((t1 (with-current-buffer b1 rcirc-last-post-time))
-                           (t2 (with-current-buffer b2 rcirc-last-post-time)))
+                     (let ((t1 (buffer-local-value 'rcirc-last-post-time b1))
+                           (t2 (buffer-local-value 'rcirc-last-post-time b2)))
                        (time-less-p t2 t1)))))
        (cl-pushnew type rcirc-activity-types)
        (unless (and (equal rcirc-activity old-activity)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]