[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/rcirc-update 1181c60 8/8: Check if server buffer is live
From: |
Philip Kaludercic |
Subject: |
feature/rcirc-update 1181c60 8/8: Check if server buffer is live |
Date: |
Tue, 15 Jun 2021 12:46:43 -0400 (EDT) |
branch: feature/rcirc-update
commit 1181c606b3ff76488c068ce057cd7596e6c49cea
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Check if server buffer is live
* rcirc.el (with-rcirc-server-buffer): Use live-buffer-p
(rcirc-buffer-nick): Use with-rcirc-server-buffer
(rcirc-switch-to-server-buffer): Use with-rcirc-server-buffer
---
lisp/net/rcirc.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 36a46dd..dfa80bb 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -681,8 +681,10 @@ that are joined after authentication."
(defmacro with-rcirc-server-buffer (&rest body)
"Evaluate BODY in the server buffer of the current channel."
(declare (indent 0) (debug t))
- `(with-current-buffer rcirc-server-buffer
- ,@body))
+ `(if (buffer-live-p rcirc-server-buffer)
+ (with-current-buffer rcirc-server-buffer
+ ,@body)
+ (user-error "Server buffer was killed")))
(define-obsolete-function-alias 'rcirc-float-time 'float-time "26.1")
@@ -1037,7 +1039,7 @@ With no argument or nil as argument, use the current
buffer."
"Return the nick associated with BUFFER.
With no argument or nil as argument, use the current buffer."
(with-current-buffer (or buffer (current-buffer))
- (with-current-buffer rcirc-server-buffer
+ (with-rcirc-server-buffer
(or rcirc-nick rcirc-default-nick))))
(defvar rcirc-max-message-length 420
@@ -2132,9 +2134,7 @@ This function does not alter the INPUT string."
(defun rcirc-switch-to-server-buffer ()
"Switch to the server buffer associated with current channel buffer."
(interactive)
- (unless (buffer-live-p rcirc-server-buffer)
- (error "No such buffer"))
- (switch-to-buffer rcirc-server-buffer))
+ (switch-to-buffer (with-rcirc-server-buffer (current-buffer))))
(defun rcirc-jump-to-first-unread-line ()
"Move the point to the first unread line in this buffer."
- feature/rcirc-update updated (fd96e3a -> 1181c60), Philip Kaludercic, 2021/06/15
- feature/rcirc-update a44e402 1/8: Preserve incoming order of messages with same timestamp, Philip Kaludercic, 2021/06/15
- feature/rcirc-update e61bdd5 2/8: Update activity string after switching to next active buffer, Philip Kaludercic, 2021/06/15
- feature/rcirc-update e17cc75 3/8: Add mouse properties to activity string, Philip Kaludercic, 2021/06/15
- feature/rcirc-update f1e79a3 5/8: Rename set-rcirc-{encode, decode}-coding-system, Philip Kaludercic, 2021/06/15
- feature/rcirc-update 88e07af 4/8: Preserve order of completion during cycling, Philip Kaludercic, 2021/06/15
- feature/rcirc-update 3e31846 6/8: Fix construction of interactive specification in rcirc-define-command, Philip Kaludercic, 2021/06/15
- feature/rcirc-update 946ceca 7/8: Improve message markup, Philip Kaludercic, 2021/06/15
- feature/rcirc-update 1181c60 8/8: Check if server buffer is live,
Philip Kaludercic <=