* gnus-art.el (gnus-article-reply-with-original): New command.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 3 Jan 2002 04:53:03 +0000 (04:53 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 3 Jan 2002 04:53:03 +0000 (04:53 +0000)
(gnus-article-followup-with-original): New command.

* gnus-msg.el (gnus-copy-article-buffer): Take optional BEG and
END parameters.
(gnus-summary-followup): Take a list of list of articles.
(gnus-inews-yank-articles): Allow lists of article/regions.

* gnus-art.el (gnus-article-read-summary-keys): `R' and `F' are no
longer the usual commands.

* gnus-fun.el (gnus-convert-image-to-gray-x-face): Use pnmnoraw.
(gnus-convert-gray-x-face-to-xpm): Don't use six parameters to
shell-command-on-region.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-fun.el
lisp/gnus-group.el
lisp/gnus-msg.el
lisp/message.el

index ca9ad64..6242e5f 100644 (file)
@@ -1,3 +1,20 @@
+2002-01-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-art.el (gnus-article-reply-with-original): New command.
+       (gnus-article-followup-with-original): New command.
+
+       * gnus-msg.el (gnus-copy-article-buffer): Take optional BEG and
+       END parameters.
+       (gnus-summary-followup): Take a list of list of articles.
+       (gnus-inews-yank-articles): Allow lists of article/regions.
+
+       * gnus-art.el (gnus-article-read-summary-keys): `R' and `F' are no
+       longer the usual commands.
+
+       * gnus-fun.el (gnus-convert-image-to-gray-x-face): Use pnmnoraw. 
+       (gnus-convert-gray-x-face-to-xpm): Don't use six parameters to
+       shell-command-on-region. 
+
 2002-01-02  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-picon.el (gnus-picon-transform-newsgroups): Fix for the case
index f02d31c..2aaa191 100644 (file)
@@ -3162,6 +3162,8 @@ If variable `gnus-use-long-file-name' is non-nil, it is
   ">" end-of-buffer
   "\C-c\C-i" gnus-info-find-node
   "\C-c\C-b" gnus-bug
+  "R" gnus-article-reply-with-original
+  "F" gnus-article-followup-with-original
   "\C-hk" gnus-article-describe-key
   "\C-hc" gnus-article-describe-key-briefly
 
@@ -4553,7 +4555,7 @@ Argument LINES specifies lines to be scrolled down."
   (interactive "P")
   (gnus-article-check-buffer)
   (let ((nosaves
-        '("q" "Q"  "c" "r" "R" "\C-c\C-f" "m"  "a" "f" "F"
+        '("q" "Q"  "c" "r" "\C-c\C-f" "m"  "a" "f"
           "Zc" "ZC" "ZE" "ZQ" "ZZ" "Zn" "ZR" "ZG" "ZN" "ZP"
           "=" "^" "\M-^" "|"))
        (nosave-but-article
@@ -4667,6 +4669,28 @@ Argument LINES specifies lines to be scrolled down."
        (describe-key-briefly key insert))
     (describe-key-briefly key insert)))
 
+(defun gnus-article-reply-with-original (&optional wide)
+  "Start composing a reply mail to the current message.
+The text in the region will be yanked.  If the region isn't active,
+the entire article will be yanked."
+  (interactive "P")
+  (let ((article (cdr gnus-article-current)))
+    (if (not mark-active)
+       (gnus-summary-reply (list (list article)) wide)
+      (gnus-summary-reply
+       (list (list article (buffer-substring (point) (mark)))) wide))))
+
+(defun gnus-article-followup-with-original ()
+  "Compose a followup to the current article.
+The text in the region will be yanked.  If the region isn't active,
+the entire article will be yanked."
+  (interactive)
+  (let ((article (cdr gnus-article-current)))
+    (if (not mark-active)
+       (gnus-summary-followup (list (list article)))
+      (gnus-summary-followup
+       (list (list article (buffer-substring (point) (mark))))))))
+
 (defun gnus-article-hide (&optional arg force)
   "Hide all the gruft in the current article.
 This means that PGP stuff, signatures, cited text and (some)
index a8ca9ab..91c4ff0 100644 (file)
@@ -74,7 +74,7 @@
        (push (cons (* step i) i) color-alist)))
     (when (file-exists-p file)
       (with-temp-buffer
-       (insert (shell-command-to-string (format "giftopnm '%s' | ppmnorm 2>/dev/null | pnmscale -width 48 -height 48 | ppmquant -map %s 2>/dev/null | ppmtopgm | pnmtoplainpnm"
+       (insert (shell-command-to-string (format "giftopnm '%s' | ppmnorm 2>/dev/null | pnmscale -width 48 -height 48 | ppmquant -map %s 2>/dev/null | ppmtopgm | pnmnoraw"
                               file mapfile)))
        (goto-char (point-min))
        (forward-line 3)
        (insert face)
        (shell-command-on-region
         (point-min) (point-max)
-        "uncompface -X | xbmtopbm | pnmtoplainpnm"
+        "uncompface -X | xbmtopbm | pnmnoraw"
         (current-buffer) t)
        (goto-char (point-min))
        (forward-line 2)
        (insert (number-to-string (* scale pixel)) " "))
       (shell-command-on-region
        (point-min) (point-max)
-       "ppmtoxpm"
-       (current-buffer) t (get-buffer-create " *junk"))
+       "ppmtoxpm 2>/dev/null"
+       (current-buffer) t)
       (buffer-string))))
 
 ;;;###autoload
index f153e50..cfa69e9 100644 (file)
@@ -412,7 +412,7 @@ For example:
 
 (defcustom gnus-group-name-charset-group-alist
   (if (or (and (fboundp 'find-coding-system) (find-coding-system 'utf-8))
-         (and (fboundp 'coding-system-p) (coding-system-p 'utf-8)))
+         (and (fboundp 'coding-system-p) (coding-system-p 'utf-8)))
       '((".*" . utf-8))
     nil)
   "Alist of group regexp and the charset for group names.
index 37489c2..900d18a 100644 (file)
@@ -560,12 +560,19 @@ a news."
 
 (defun gnus-summary-followup (yank &optional force-news)
   "Compose a followup to an article.
-If prefix argument YANK is non-nil, original article is yanked automatically."
+If prefix argument YANK is non-nil, the original article is yanked
+automatically.
+YANK is a list of elements, where the car of each element is the
+article number, and the two following numbers is the region to be
+yanked."
   (interactive
    (list (and current-prefix-arg
              (gnus-summary-work-articles 1))))
   (when yank
-    (gnus-summary-goto-subject (car yank)))
+    (gnus-summary-goto-subject
+     (if (listp (car yank))
+        (caar yank)
+       (car yank))))
   (save-window-excursion
     (gnus-summary-select-article))
   (let ((headers (gnus-summary-article-header (gnus-summary-article-number)))
@@ -593,18 +600,21 @@ If prefix argument YANK is non-nil, original article is yanked automatically."
   (gnus-summary-followup (gnus-summary-work-articles arg) t))
 
 (defun gnus-inews-yank-articles (articles)
-  (let (beg article)
+  (let (beg article yank-string)
     (message-goto-body)
     (while (setq article (pop articles))
+      (when (listp article)
+       (setq yank-string (nth 1 article)
+             article (nth 0 article)))
       (save-window-excursion
        (set-buffer gnus-summary-buffer)
        (gnus-summary-select-article nil nil nil article)
        (gnus-summary-remove-process-mark article))
-      (gnus-copy-article-buffer)
+      (gnus-copy-article-buffer nil yank-string)
       (let ((message-reply-buffer gnus-article-copy)
            (message-reply-headers
+            ;; The headers are decoded.
             (with-current-buffer gnus-article-copy
-              ;; The headers are decoded.
               (nnheader-parse-head t))))
        (message-yank-original)
        (setq beg (or beg (mark t))))
@@ -654,7 +664,7 @@ header line with the old Message-ID."
 
 \f
 
-(defun gnus-copy-article-buffer (&optional article-buffer)
+(defun gnus-copy-article-buffer (&optional article-buffer yank-string)
   ;; make a copy of the article buffer with all text properties removed
   ;; this copy is in the buffer gnus-article-copy.
   ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
@@ -681,6 +691,10 @@ header line with the old Message-ID."
            (widen)
            (copy-to-buffer gnus-article-copy (point-min) (point-max))
            (set-buffer gnus-article-copy)
+           (when yank-string
+             (message-goto-body)
+             (delete-region (point) (point-max))
+             (insert yank-string))
            (gnus-article-delete-text-of-type 'annotation)
            (gnus-remove-text-with-property 'gnus-prev)
            (gnus-remove-text-with-property 'gnus-next)
@@ -693,8 +707,8 @@ header line with the old Message-ID."
            (goto-char (point-min))
            (while (looking-at message-unix-mail-delimiter)
              (forward-line 1))
-           (setq beg (point))
-           (setq end (or (message-goto-body) beg))
+           (setq beg (point)
+                 end (or (message-goto-body) beg))
            ;; Delete the headers from the displayed articles.
            (set-buffer gnus-article-copy)
            (delete-region (goto-char (point-min))
@@ -904,7 +918,10 @@ If VERY-WIDE, make a very wide reply."
              (gnus-summary-work-articles 1))))
   ;; Stripping headers should be specified with mail-yank-ignored-headers.
   (when yank
-    (gnus-summary-goto-subject (car yank)))
+    (gnus-summary-goto-subject
+     (if (listp (car yank))
+        (caar yank)
+       (car yank))))
   (let ((gnus-article-reply (or yank (gnus-summary-article-number)))
        (headers ""))
     (gnus-setup-message (if yank 'reply-yank 'reply)
index 50cf111..d92a5b6 100644 (file)
@@ -3923,7 +3923,11 @@ Headers already prepared in the buffer are not modified."
                    ;; This header didn't exist, so we insert it.
                    (goto-char (point-max))
                    (insert (if (stringp header) header (symbol-name header))
-                           ": " value "\n")
+                           ": " value)
+                   ;; We check whether the value was ended by a
+                   ;; newline.  If now, we insert one.
+                   (unless (bolp)
+                     (insert "\n"))
                    (forward-line -1))
                ;; The value of this header was empty, so we clear
                ;; totally and insert the new value.