2001-02-23 17:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 23 Feb 2001 22:55:50 +0000 (22:55 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 23 Feb 2001 22:55:50 +0000 (22:55 +0000)
* gnus-art.el (gnus-article-edit-done): Don't use
gnus-article-edit-exit.
(gnus-article-edit-exit): Confirm and insert original-article-buffer.

lisp/ChangeLog
lisp/gnus-art.el

index 221e0a5..6ed7b6a 100644 (file)
@@ -1,5 +1,9 @@
 2001-02-23 17:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
+       * gnus-art.el (gnus-article-edit-done): Don't use
+       gnus-article-edit-exit.
+       (gnus-article-edit-exit): Confirm and insert original-article-buffer.
+
        * gnus.el (gnus-parameters): New.
        (gnus-parameters-get-parameter): New.
        (gnus-group-find-parameter): Use it.
index 6002dd8..5910096 100644 (file)
@@ -4600,7 +4600,20 @@ groups."
   (let ((func gnus-article-edit-done-function)
        (buf (current-buffer))
        (start (window-start)))
-    (gnus-article-edit-exit)
+    ;; We remove all text props from the article buffer.
+    (let ((content
+          (buffer-substring-no-properties (point-min) (point-max)))
+         (p (point)))
+      (erase-buffer)
+      (insert content)
+      (let ((winconf gnus-prev-winconf))
+       (gnus-article-mode)
+       (set-window-configuration winconf)
+       ;; Tippy-toe some to make sure that point remains where it was.
+       (save-current-buffer
+         (set-buffer buf)
+         (set-window-start (get-buffer-window (current-buffer)) start)
+         (goto-char p))))
     (save-excursion
       (set-buffer buf)
       (let ((buffer-read-only nil))
@@ -4624,21 +4637,22 @@ groups."
 (defun gnus-article-edit-exit ()
   "Exit the article editing without updating."
   (interactive)
-  ;; We remove all text props from the article buffer.
-  (let ((buf (buffer-substring-no-properties (point-min) (point-max)))
-       (curbuf (current-buffer))
-       (p (point))
-       (window-start (window-start)))
-    (erase-buffer)
-    (insert buf)
-    (let ((winconf gnus-prev-winconf))
-      (gnus-article-mode)
-      (set-window-configuration winconf)
-      ;; Tippy-toe some to make sure that point remains where it was.
-      (save-current-buffer
-       (set-buffer curbuf)
-       (set-window-start (get-buffer-window (current-buffer)) window-start)
-       (goto-char p)))))
+  (when (or (not (buffer-modified-p))
+           (yes-or-no-p "Article modified; kill anyway? "))
+    (let ((curbuf (current-buffer))
+         (p (point))
+         (window-start (window-start)))
+      (erase-buffer)
+      (if (gnus-buffer-live-p gnus-original-article-buffer)
+         (insert-buffer gnus-original-article-buffer))
+      (let ((winconf gnus-prev-winconf))
+       (gnus-article-mode)
+       (set-window-configuration winconf)
+       ;; Tippy-toe some to make sure that point remains where it was.
+       (save-current-buffer
+         (set-buffer curbuf)
+         (set-window-start (get-buffer-window (current-buffer)) window-start)
+         (goto-char p))))))
 
 (defun gnus-article-edit-full-stops ()
   "Interactively repair spacing at end of sentences."