summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-sum.el
diff options
context:
space:
mode:
authorBasil L. Contovounesios <contovob@tcd.ie>2019-05-05 01:28:57 +0100
committerBasil L. Contovounesios <contovob@tcd.ie>2019-05-30 02:56:28 +0100
commitceca1740ea2c9bc98da8c11765b78c696b27c79e (patch)
tree8f878809e34325af181edac66385307345c3ef03 /lisp/gnus/gnus-sum.el
parent46a176169b9050a5e6d97b11f265bd58b4b5eb05 (diff)
downloademacs-ceca1740ea2c9bc98da8c11765b78c696b27c79e.tar.gz
emacs-ceca1740ea2c9bc98da8c11765b78c696b27c79e.tar.bz2
emacs-ceca1740ea2c9bc98da8c11765b78c696b27c79e.zip
Simplify Gnus buffer liveness checking and killing
* lisp/gnus/gnus-agent.el (gnus-agent-synchronize-group-flags): Fix indentation. * lisp/gnus/gnus-util.el (gnus-buffer-exists-p): Define as obsolete alias of gnus-buffer-live-p. (gnus-buffer-live-p): If the given argument is or names a live buffer, return the corresponding buffer object instead of a boolean. * lisp/gnus/gnus-win.el (gnus-delete-windows-in-gnusey-frames) (gnus-remove-some-windows): Simplify. * lisp/gnus/gnus.el (gnus-prune-buffers): Redefine as alias of gnus-buffers. (gnus-kill-buffer, gnus-buffers, gnus-group-find-parameter): * lisp/gnus/gnus-art.el (gnus-kill-sticky-article-buffers) (gnus-request-article-this-buffer): * lisp/gnus/gnus-bcklg.el (gnus-backlog-shutdown): * lisp/gnus/gnus-cus.el (gnus-group-customize) (gnus-agent-customize-category): * lisp/gnus/gnus-draft.el (gnus-draft-edit-message): * lisp/gnus/gnus-group.el (gnus-group-set-mode-line) (gnus--abort-on-unsaved-message-buffers, gnus-group-compact-group): * lisp/gnus/gnus-msg.el (gnus-inews-add-send-actions) (gnus-summary-supersede-article, gnus-copy-article-buffer): * lisp/gnus/gnus-score.el (gnus-score-edit-current-scores) (gnus-score-edit-file): * lisp/gnus/gnus-spec.el (gnus-update-format-specifications): * lisp/gnus/gnus-srvr.el (gnus-server-compact-server): * lisp/gnus/gnus-start.el (gnus-clear-system, gnus-dribble-enter) (gnus-dribble-save, gnus-dribble-clear, gnus-save-newsrc-file): * lisp/gnus/gnus-sum.el (gnus-summary-setup-buffer) (gnus-update-summary-mark-positions, gnus-summary-exit) (gnus-deaden-summary, gnus-kill-or-deaden-summary) (gnus-summary-next-group): * lisp/gnus/gnus-win.el (gnus-configure-frame): * lisp/gnus/mail-source.el (mail-source-movemail): * lisp/gnus/message.el (message-with-reply-buffer) (message-with-reply, message-send-and-exit) (message-send-mail-with-sendmail, message-pop-to-buffer) (message-do-send-housekeeping, message-forward-make-body-plain) (message-forward-make-body-mml): * lisp/gnus/mm-decode.el (mm-display-external, mm-remove-part): * lisp/gnus/nnbabyl.el (nnbabyl-server-opened) (nnbabyl-possibly-change-newsgroup, nnbabyl-read-mbox) (nnbabyl-check-mbox): * lisp/gnus/nndiary.el (nndiary-save-nov): * lisp/gnus/nndoc.el (nndoc-close-group) (nndoc-possibly-change-buffer): * lisp/gnus/nnfolder.el (nnfolder-close-group, nnfolder-save-nov): * lisp/gnus/nnimap.el (nnimap-make-process-buffer, nnimap-keepalive) (nnimap-find-connection): * lisp/gnus/nnmail.el (nnmail-cache-open, nnmail-cache-close): * lisp/gnus/nnmbox.el (nnmbox-close-server, nnmbox-server-opened) (nnmbox-possibly-change-newsgroup, nnmbox-read-mbox): * lisp/gnus/nnml.el (nnml-save-incremental-nov, nnml-open-nov) (nnml-save-nov): * lisp/gnus/nnoo.el (nnoo-server-opened): * lisp/gnus/nntp.el (nntp-kill-buffer, nntp-make-process-buffer) (nntp-open-connection, nntp-async-trigger): * lisp/net/mairix.el (mairix-gnus-fetch-field): Simplify buffer liveness checking and killing, replacing buffer-name with buffer-live-p and gnus-buffer-exists-p with gnus-buffer-live-p or equivalent where applicable.
Diffstat (limited to 'lisp/gnus/gnus-sum.el')
-rw-r--r--lisp/gnus/gnus-sum.el18
1 files changed, 8 insertions, 10 deletions
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 31958ff7b04..5d5d2ec464b 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3519,8 +3519,7 @@ Returns non-nil if the setup was successful."
(dead-name (concat "*Dead Summary "
(gnus-group-decoded-name group) "*")))
;; If a dead summary buffer exists, we kill it.
- (when (gnus-buffer-live-p dead-name)
- (gnus-kill-buffer dead-name))
+ (gnus-kill-buffer dead-name)
(if (get-buffer buffer)
(progn
(set-buffer buffer)
@@ -3622,7 +3621,7 @@ buffer that was in action when the last article was fetched."
(defun gnus-update-summary-mark-positions ()
"Compute where the summary marks are to go."
(save-excursion
- (when (gnus-buffer-exists-p gnus-summary-buffer)
+ (when (gnus-buffer-live-p gnus-summary-buffer)
(set-buffer gnus-summary-buffer))
(let ((spec gnus-summary-line-format-spec)
pos)
@@ -7326,7 +7325,7 @@ If FORCE (the prefix), also save the .newsrc file(s)."
(gnus-summary-update-info))
(gnus-close-group group)
;; Make sure where we were, and go to next newsgroup.
- (when (buffer-live-p (get-buffer gnus-group-buffer))
+ (when (gnus-buffer-live-p gnus-group-buffer)
(set-buffer gnus-group-buffer))
(unless quit-config
(gnus-group-jump-to-group group))
@@ -7501,8 +7500,7 @@ The state which existed when entering the ephemeral is reset."
(defun gnus-deaden-summary ()
"Make the current summary buffer into a dead summary buffer."
;; Kill any previous dead summary buffer.
- (when (and gnus-dead-summary
- (buffer-name gnus-dead-summary))
+ (when (buffer-live-p gnus-dead-summary)
(with-current-buffer gnus-dead-summary
(when gnus-dead-summary-mode
(kill-buffer (current-buffer)))))
@@ -7520,7 +7518,7 @@ The state which existed when entering the ephemeral is reset."
(defun gnus-kill-or-deaden-summary (buffer)
"Kill or deaden the summary BUFFER."
(save-excursion
- (when (and (buffer-name buffer)
+ (when (and (buffer-live-p buffer)
(not gnus-single-article-buffer))
(with-current-buffer buffer
(gnus-kill-buffer gnus-article-buffer)
@@ -7529,12 +7527,12 @@ The state which existed when entering the ephemeral is reset."
;; Kill the buffer.
(gnus-kill-summary-on-exit
(when (and gnus-use-trees
- (gnus-buffer-exists-p buffer))
+ (gnus-buffer-live-p buffer))
(with-current-buffer buffer
(gnus-tree-close)))
(gnus-kill-buffer buffer))
;; Deaden the buffer.
- ((gnus-buffer-exists-p buffer)
+ ((gnus-buffer-live-p buffer)
(with-current-buffer buffer
(gnus-deaden-summary))))))
@@ -7605,7 +7603,7 @@ previous group instead."
(and unreads (not (zerop unreads))))
(gnus-summary-read-group
target-group nil no-article
- (and (buffer-name current-buffer) current-buffer)
+ (and (buffer-live-p current-buffer) current-buffer)
nil backward))
(setq entered t)
(setq current-group target-group