diff options
author | Basil L. Contovounesios <contovob@tcd.ie> | 2019-05-05 01:28:57 +0100 |
---|---|---|
committer | Basil L. Contovounesios <contovob@tcd.ie> | 2019-05-30 02:56:28 +0100 |
commit | ceca1740ea2c9bc98da8c11765b78c696b27c79e (patch) | |
tree | 8f878809e34325af181edac66385307345c3ef03 /lisp/gnus/nnmail.el | |
parent | 46a176169b9050a5e6d97b11f265bd58b4b5eb05 (diff) | |
download | emacs-ceca1740ea2c9bc98da8c11765b78c696b27c79e.tar.gz |
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/nnmail.el')
-rw-r--r-- | lisp/gnus/nnmail.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 37f6e75b90e..ed3d5712708 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -1561,8 +1561,7 @@ See the documentation for the variable `nnmail-split-fancy' for details." (defun nnmail-cache-open () (if (or (not nnmail-treat-duplicates) - (and nnmail-cache-buffer - (buffer-name nnmail-cache-buffer))) + (buffer-live-p nnmail-cache-buffer)) () ; The buffer is open. (with-current-buffer (setq nnmail-cache-buffer @@ -1574,9 +1573,8 @@ See the documentation for the variable `nnmail-split-fancy' for details." (current-buffer)))) (defun nnmail-cache-close () - (when (and nnmail-cache-buffer - nnmail-treat-duplicates - (buffer-name nnmail-cache-buffer) + (when (and nnmail-treat-duplicates + (buffer-live-p nnmail-cache-buffer) (buffer-modified-p nnmail-cache-buffer)) (with-current-buffer nnmail-cache-buffer ;; Weed out the excess number of Message-IDs. |