From: yamaoka Date: Tue, 14 Feb 2006 01:55:36 +0000 (+0000) Subject: Synch to No Gnus 200602140155. X-Git-Tag: t-gnus-6_17_4-quimby-~99 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d056a89af3f8cd41fd4afde3b25b25a8ba46e457;p=elisp%2Fgnus.git- Synch to No Gnus 200602140155. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c7355d1..d67e5f9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2006-02-14 Katsumi Yamaoka + + * gnus-draft.el (gnus-draft-send): Replace message-narrow-to-head + with message-narrow-to-headers. + (gnus-draft-setup): Narrow to header to run message-fetch-field. + (gnus-draft-check-draft-articles articles): New function. + (gnus-draft-edit-message, gnus-draft-send-message): Use it. + 2006-02-13 Reiner Steib * gnus-art.el (gnus-article-browse-html-parts): @@ -7,8 +15,8 @@ 2006-02-13 Andreas Seltenreich - * nnweb.el (nnweb-google-wash-article): Update regexps. - (nnweb-group-alist): Use defvoo instead of defvar. + * nnweb.el (nnweb-google-wash-article): Update regexps. + (nnweb-group-alist): Use defvoo instead of defvar. 2006-02-13 Katsumi Yamaoka diff --git a/lisp/gnus-draft.el b/lisp/gnus-draft.el index a808eef..ced0a40 100644 --- a/lisp/gnus-draft.el +++ b/lisp/gnus-draft.el @@ -99,6 +99,7 @@ (interactive) (let ((article (gnus-summary-article-number)) (group gnus-newsgroup-name)) + (gnus-draft-check-draft-articles (list article)) (gnus-summary-mark-as-read article gnus-canceled-mark) (gnus-draft-setup article group t) (set-buffer-modified-p t) @@ -123,6 +124,7 @@ (let* ((articles (gnus-summary-work-articles n)) (total (length articles)) article) + (gnus-draft-check-draft-articles articles) (while (setq article (pop articles)) (gnus-summary-remove-process-mark article) (unless (memq article gnus-newsgroup-unsendable) @@ -153,7 +155,7 @@ ;; We read the meta-information that says how and where ;; this message is to be sent. (save-restriction - (message-narrow-to-head) + (message-narrow-to-headers) (when (re-search-forward (concat "^" (regexp-quote gnus-agent-target-move-group-header) ":") nil t) @@ -264,9 +266,12 @@ (goto-char (point-min)) (search-forward "\n\n") (forward-char -1) + (save-restriction + (narrow-to-region (point-min) (point)) + (setq ga + (message-fetch-field gnus-draft-meta-information-header))) (insert mail-header-separator) (forward-line 1) - (setq ga (message-fetch-field gnus-draft-meta-information-header)) (message-set-auto-save-file-name)))) (gnus-backlog-remove-article group narticle) (when (and ga @@ -291,6 +296,32 @@ "Say whether ARTICLE is sendable." (not (memq article gnus-newsgroup-unsendable))) +(defun gnus-draft-check-draft-articles (articles) + "Check whether the draft articles ARTICLES are under edit." + (when (equal gnus-newsgroup-name "nndraft:drafts") + (let ((buffers (buffer-list)) + file buffs buff) + (save-current-buffer + (while (and articles + (not buff)) + (setq file (nndraft-article-filename (pop articles)) + buffs buffers) + (while buffs + (set-buffer (setq buff (pop buffs))) + (if (and buffer-file-name + (string-equal (file-truename buffer-file-name) + (file-truename file)) + (buffer-modified-p)) + (setq buffs nil) + (setq buff nil))))) + (when buff + (let* ((window (get-buffer-window buff t)) + (frame (and window (window-frame window)))) + (if frame + (gnus-select-frame-set-input-focus frame) + (pop-to-buffer buff t))) + (error "The draft %s is under edit" file))))) + (provide 'gnus-draft) ;;; gnus-draft.el ends here