Function: gnus-draft-check-draft-articles
gnus-draft-check-draft-articles is a byte-compiled function defined in
gnus-draft.el.gz.
Signature
(gnus-draft-check-draft-articles ARTICLES)
Documentation
Check whether the draft articles ARTICLES are under edit.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/gnus-draft.el.gz
(defun gnus-draft-check-draft-articles (articles)
"Check whether the draft articles ARTICLES are under edit."
(when (equal gnus-newsgroup-name "nndraft:drafts")
(let* ((files (mapcar #'nndraft-article-filename articles))
(buffs (delq nil (mapcar (lambda (f)
(find-buffer-visiting
f (lambda (b) (buffer-modified-p b))))
files))))
(when buffs
(if (= 1 (length buffs))
;; We might have arrived here via `gnus-draft-edit-message';
;; either way show the user the draft with unsaved changes.
(let* ((window (get-buffer-window (car buffs) t))
(frame (and window (window-frame window))))
(if frame
(select-frame-set-input-focus frame)
(pop-to-buffer (car buffs) t))
(error "Draft is already under edit"))
;; Otherwise we got here from `gnus-draft-send-message', and
;; the main thing is to interrupt the sending.
(display-buffer (list-buffers-noselect t buffs))
(error "Some drafts have unsaved changes: %S" buffs))))))