comparison lisp/gnus/gnus-art.el @ 96498:1f27a4bf06f5

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1309
author Miles Bader <miles@gnu.org>
date Fri, 04 Jul 2008 00:07:47 +0000
parents 64da3838a9aa
children 0b339c48424c
comparison
equal deleted inserted replaced
96497:885e5368ecb2 96498:1f27a4bf06f5
550 * gnus-summary-save-in-file (article format) 550 * gnus-summary-save-in-file (article format)
551 * gnus-summary-save-body-in-file (article body) 551 * gnus-summary-save-body-in-file (article body)
552 * gnus-summary-save-in-vm (use VM's folder format) 552 * gnus-summary-save-in-vm (use VM's folder format)
553 * gnus-summary-write-to-file (article format -- overwrite) 553 * gnus-summary-write-to-file (article format -- overwrite)
554 * gnus-summary-write-body-to-file (article body -- overwrite) 554 * gnus-summary-write-body-to-file (article body -- overwrite)
555 * gnus-summary-save-in-pipe (article format)
555 556
556 The symbol of each function may have the following properties: 557 The symbol of each function may have the following properties:
557 558
558 * :decode 559 * :decode
559 The value non-nil means save decoded articles. This is meaningful 560 The value non-nil means save decoded articles. This is meaningful
560 only with `gnus-summary-save-in-file', `gnus-summary-save-body-in-file', 561 only with `gnus-summary-save-in-file', `gnus-summary-save-body-in-file',
561 `gnus-summary-write-to-file', and `gnus-summary-write-body-to-file'. 562 `gnus-summary-write-to-file', `gnus-summary-write-body-to-file', and
563 `gnus-summary-save-in-pipe'.
562 564
563 * :function 565 * :function
564 The value specifies an alternative function which appends, not 566 The value specifies an alternative function which appends, not
565 overwrites, articles to a file. This implies that when saving many 567 overwrites, articles to a file. This implies that when saving many
566 articles at a time, `gnus-prompt-before-saving' is bound to t and all 568 articles at a time, `gnus-prompt-before-saving' is bound to t and all
579 (function-item gnus-summary-save-in-file) 581 (function-item gnus-summary-save-in-file)
580 (function-item gnus-summary-save-body-in-file) 582 (function-item gnus-summary-save-body-in-file)
581 (function-item gnus-summary-save-in-vm) 583 (function-item gnus-summary-save-in-vm)
582 (function-item gnus-summary-write-to-file) 584 (function-item gnus-summary-write-to-file)
583 (function-item gnus-summary-write-body-to-file) 585 (function-item gnus-summary-write-body-to-file)
586 (function-item gnus-summary-save-in-pipe)
584 (function))) 587 (function)))
585 588
586 (defcustom gnus-article-save-coding-system 589 (defcustom gnus-article-save-coding-system
587 (or (and (mm-coding-system-p 'utf-8) 'utf-8) 590 (or (and (mm-coding-system-p 'utf-8) 'utf-8)
588 (and (mm-coding-system-p 'iso-2022-7bit) 'iso-2022-7bit) 591 (and (mm-coding-system-p 'iso-2022-7bit) 'iso-2022-7bit)
3934 "Save %s body in file" filename 3937 "Save %s body in file" filename
3935 gnus-file-save-name gnus-newsgroup-name 3938 gnus-file-save-name gnus-newsgroup-name
3936 gnus-current-headers nil 'gnus-newsgroup-last-directory)) 3939 gnus-current-headers nil 'gnus-newsgroup-last-directory))
3937 (gnus-summary-save-body-in-file filename t)) 3940 (gnus-summary-save-body-in-file filename t))
3938 3941
3942 (put 'gnus-summary-save-in-pipe :decode t)
3943 (put 'gnus-summary-save-in-pipe :headers 'gnus-saved-headers)
3939 (defun gnus-summary-save-in-pipe (&optional command) 3944 (defun gnus-summary-save-in-pipe (&optional command)
3940 "Pipe this article to subprocess." 3945 "Pipe this article to subprocess."
3941 (setq command 3946 (let ((default (or gnus-summary-pipe-output-default-command
3942 (cond ((and (eq command 'default) 3947 gnus-last-shell-command)))
3943 gnus-last-shell-command) 3948 (unless (stringp command)
3944 gnus-last-shell-command) 3949 (setq command
3945 ((stringp command) 3950 (if (and (eq command 'default) default)
3946 command) 3951 default
3947 (t (gnus-read-shell-command 3952 (gnus-read-shell-command
3948 (format 3953 (format
3949 "Shell command on %s: " 3954 "Shell command on %s: "
3950 (if (and gnus-number-of-articles-to-be-saved 3955 (if (and gnus-number-of-articles-to-be-saved
3951 (> gnus-number-of-articles-to-be-saved 1)) 3956 (> gnus-number-of-articles-to-be-saved 1))
3952 (format "these %d articles" 3957 (format "these %d articles"
3953 gnus-number-of-articles-to-be-saved) 3958 gnus-number-of-articles-to-be-saved)
3954 "this article")) 3959 "this article"))
3955 gnus-last-shell-command)))) 3960 default))))
3956 (when (string-equal command "") 3961 (when (string-equal command "")
3957 (if gnus-last-shell-command 3962 (if default
3958 (setq command gnus-last-shell-command) 3963 (setq command default)
3959 (error "A command is required"))) 3964 (error "A command is required"))))
3960 (gnus-eval-in-buffer-window gnus-article-buffer 3965 (gnus-eval-in-buffer-window gnus-save-article-buffer
3961 (save-restriction 3966 (save-restriction
3962 (widen) 3967 (widen)
3963 (shell-command-on-region (point-min) (point-max) command nil))) 3968 (shell-command-on-region (point-min) (point-max) command nil)))
3964 (setq gnus-last-shell-command command)) 3969 (setq gnus-summary-pipe-output-default-command command))
3965 3970
3966 (defun gnus-summary-pipe-to-muttprint (&optional command) 3971 (defun gnus-summary-pipe-to-muttprint (&optional command)
3967 "Pipe this article to muttprint." 3972 "Pipe this article to muttprint."
3968 (setq command (read-string 3973 (setq command (read-string
3969 "Print using command: " gnus-summary-muttprint-program 3974 "Print using command: " gnus-summary-muttprint-program
3970 nil gnus-summary-muttprint-program)) 3975 nil gnus-summary-muttprint-program))
3971 (gnus-summary-save-in-pipe command)) 3976 (let ((gnus-last-shell-command gnus-last-shell-command))
3977 (gnus-summary-save-in-pipe command)
3978 (setq gnus-summary-muttprint-program gnus-last-shell-command)))
3972 3979
3973 ;;; Article file names when saving. 3980 ;;; Article file names when saving.
3974 3981
3975 (defun gnus-capitalize-newsgroup (newsgroup) 3982 (defun gnus-capitalize-newsgroup (newsgroup)
3976 "Capitalize NEWSGROUP name." 3983 "Capitalize NEWSGROUP name."