(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-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
">" 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
(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
(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)
(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
(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.
(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)))
(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))))
\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
(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)
(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))
(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)
;; 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.