diff options
| author | Miles Bader | 2008-08-07 07:18:07 +0000 |
|---|---|---|
| committer | Miles Bader | 2008-08-07 07:18:07 +0000 |
| commit | 6ecfe5c26e45a5d4da6cdf4b27f3e38b86998870 (patch) | |
| tree | 3b4922f76d9a6b518f6a841832dd69905436a09c | |
| parent | 5f14a5b35ee77469060be6d4fb4ce8a1ef0624fc (diff) | |
| download | emacs-6ecfe5c26e45a5d4da6cdf4b27f3e38b86998870.tar.gz emacs-6ecfe5c26e45a5d4da6cdf4b27f3e38b86998870.zip | |
Merge from gnus--devo--0
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1372
| -rw-r--r-- | doc/misc/ChangeLog | 12 | ||||
| -rw-r--r-- | doc/misc/gnus.texi | 23 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 22 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 81 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 88 | ||||
| -rw-r--r-- | lisp/gnus/rfc2104.el | 13 |
6 files changed, 168 insertions, 71 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index b80aeb1abd0..3c15191db92 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2008-08-07 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2 | |||
| 3 | * gnus.texi (Sorting the Summary Buffer, Summary Sorting): Add | ||
| 4 | gnus-summary-sort-by-most-recent-number and | ||
| 5 | gnus-summary-sort-by-most-recent-date. | ||
| 6 | (Summary Sorting): Explain prefix argument. | ||
| 7 | |||
| 8 | 2008-08-07 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 9 | |||
| 10 | * gnus.texi (Saving Articles): Mention symbolic prefix `r' for | ||
| 11 | gnus-summary-pipe-output. | ||
| 12 | |||
| 1 | 2008-08-03 Michael Albinus <michael.albinus@gmx.de> | 13 | 2008-08-03 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 14 | ||
| 3 | * dbus.texi (Receiving Method Calls): Document error handling of own | 15 | * dbus.texi (Receiving Method Calls): Document error handling of own |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 15a0109d94d..ebede967116 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -8111,11 +8111,13 @@ tickles your fancy. | |||
| 8111 | 8111 | ||
| 8112 | @findex gnus-article-sort-functions | 8112 | @findex gnus-article-sort-functions |
| 8113 | @findex gnus-article-sort-by-date | 8113 | @findex gnus-article-sort-by-date |
| 8114 | @findex gnus-article-sort-by-most-recent-date | ||
| 8114 | @findex gnus-article-sort-by-score | 8115 | @findex gnus-article-sort-by-score |
| 8115 | @findex gnus-article-sort-by-subject | 8116 | @findex gnus-article-sort-by-subject |
| 8116 | @findex gnus-article-sort-by-author | 8117 | @findex gnus-article-sort-by-author |
| 8117 | @findex gnus-article-sort-by-random | 8118 | @findex gnus-article-sort-by-random |
| 8118 | @findex gnus-article-sort-by-number | 8119 | @findex gnus-article-sort-by-number |
| 8120 | @findex gnus-article-sort-by-most-recent-number | ||
| 8119 | If you are using an unthreaded display for some strange reason or | 8121 | If you are using an unthreaded display for some strange reason or |
| 8120 | other, you have to fiddle with the @code{gnus-article-sort-functions} | 8122 | other, you have to fiddle with the @code{gnus-article-sort-functions} |
| 8121 | variable. It is very similar to the | 8123 | variable. It is very similar to the |
| @@ -8518,9 +8520,11 @@ Save the current article in a VM folder | |||
| 8518 | Save the current article in a pipe. Uhm, like, what I mean is---Pipe | 8520 | Save the current article in a pipe. Uhm, like, what I mean is---Pipe |
| 8519 | the current article to a process (@code{gnus-summary-pipe-output}). | 8521 | the current article to a process (@code{gnus-summary-pipe-output}). |
| 8520 | If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the | 8522 | If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the |
| 8521 | complete headers in the piped output. The | 8523 | complete headers in the piped output. The symbolic prefix @code{r} is |
| 8522 | @code{gnus-summary-pipe-output-default-command} variable can be set to a | 8524 | special; it lets this command pipe a raw article including all headers. |
| 8523 | string containing the default command and options (default @code{nil}). | 8525 | The @code{gnus-summary-pipe-output-default-command} variable can be set |
| 8526 | to a string containing the default command and options (default | ||
| 8527 | @code{nil}). | ||
| 8524 | 8528 | ||
| 8525 | @item O P | 8529 | @item O P |
| 8526 | @kindex O P (Summary) | 8530 | @kindex O P (Summary) |
| @@ -10793,6 +10797,12 @@ can't really see why you'd want that. | |||
| 10793 | @findex gnus-summary-sort-by-number | 10797 | @findex gnus-summary-sort-by-number |
| 10794 | Sort by article number (@code{gnus-summary-sort-by-number}). | 10798 | Sort by article number (@code{gnus-summary-sort-by-number}). |
| 10795 | 10799 | ||
| 10800 | @item C-c C-s C-m C-n | ||
| 10801 | @kindex C-c C-s C-n (Summary) | ||
| 10802 | @findex gnus-summary-sort-by-most-recent-number | ||
| 10803 | Sort by most recent article number | ||
| 10804 | (@code{gnus-summary-sort-by-most-recent-number}). | ||
| 10805 | |||
| 10796 | @item C-c C-s C-a | 10806 | @item C-c C-s C-a |
| 10797 | @kindex C-c C-s C-a (Summary) | 10807 | @kindex C-c C-s C-a (Summary) |
| 10798 | @findex gnus-summary-sort-by-author | 10808 | @findex gnus-summary-sort-by-author |
| @@ -10813,6 +10823,11 @@ Sort by subject (@code{gnus-summary-sort-by-subject}). | |||
| 10813 | @findex gnus-summary-sort-by-date | 10823 | @findex gnus-summary-sort-by-date |
| 10814 | Sort by date (@code{gnus-summary-sort-by-date}). | 10824 | Sort by date (@code{gnus-summary-sort-by-date}). |
| 10815 | 10825 | ||
| 10826 | @item C-c C-s C-m C-d | ||
| 10827 | @kindex C-c C-s C-m C-d (Summary) | ||
| 10828 | @findex gnus-summary-sort-by-most-recent-date | ||
| 10829 | Sort by most recent date (@code{gnus-summary-sort-by-most-recent-date}). | ||
| 10830 | |||
| 10816 | @item C-c C-s C-l | 10831 | @item C-c C-s C-l |
| 10817 | @kindex C-c C-s C-l (Summary) | 10832 | @kindex C-c C-s C-l (Summary) |
| 10818 | @findex gnus-summary-sort-by-lines | 10833 | @findex gnus-summary-sort-by-lines |
| @@ -10847,6 +10862,8 @@ root-by-root basis, which might not be what you were looking for. To | |||
| 10847 | toggle whether to use threading, type @kbd{T T} (@pxref{Thread | 10862 | toggle whether to use threading, type @kbd{T T} (@pxref{Thread |
| 10848 | Commands}). | 10863 | Commands}). |
| 10849 | 10864 | ||
| 10865 | If a prefix argument if given, the sort order is reversed. | ||
| 10866 | |||
| 10850 | 10867 | ||
| 10851 | @node Finding the Parent | 10868 | @node Finding the Parent |
| 10852 | @section Finding the Parent | 10869 | @section Finding the Parent |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 19b98a088ca..23477cc631a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -4,6 +4,28 @@ | |||
| 4 | * gnus-start.el: | 4 | * gnus-start.el: |
| 5 | * gnus-registry.el: Remove VMS support. | 5 | * gnus-registry.el: Remove VMS support. |
| 6 | 6 | ||
| 7 | 2008-07-30 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 8 | |||
| 9 | * rfc2104.el (rfc2104-string-make-unibyte): Define it as a compiler | ||
| 10 | macro. | ||
| 11 | (rfc2104-hash): Use it. | ||
| 12 | |||
| 13 | 2008-07-30 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 14 | |||
| 15 | * gnus-sum.el (gnus-summary-sort-by-most-recent-number) | ||
| 16 | (gnus-summary-sort-by-most-recent-date): New commands. | ||
| 17 | (gnus-summary-mode-map, gnus-summary-make-menu-bar): Add key bindings | ||
| 18 | and menu entries. | ||
| 19 | |||
| 20 | 2008-07-29 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 21 | |||
| 22 | * gnus-art.el (gnus-summary-save-in-pipe): Generate work buffer always; | ||
| 23 | don't redisplay article for raw contents; remove plural articles stuff. | ||
| 24 | |||
| 25 | * gnus-sum.el (gnus-summary-pipe-output): Pipe raw articles by symbolic | ||
| 26 | prefix `r'; use gnus-summary-save-in-pipe directly instead of relying | ||
| 27 | on gnus-summary-save-article; display results properly. | ||
| 28 | |||
| 7 | 2008-07-24 Katsumi Yamaoka <yamaoka@jpl.org> | 29 | 2008-07-24 Katsumi Yamaoka <yamaoka@jpl.org> |
| 8 | 30 | ||
| 9 | * gnus-art.el (gnus-summary-save-in-pipe): Add optional argument `raw'. | 31 | * gnus-art.el (gnus-summary-save-in-pipe): Add optional argument `raw'. |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 16e65a63e27..3d5ce9b39cc 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -3955,60 +3955,41 @@ Valid values for COMMAND include: | |||
| 3955 | last used for saving. | 3955 | last used for saving. |
| 3956 | Non-nil value for RAW overrides `:decode' and `:headers' properties | 3956 | Non-nil value for RAW overrides `:decode' and `:headers' properties |
| 3957 | and the raw article including all headers will be piped." | 3957 | and the raw article including all headers will be piped." |
| 3958 | (let ((save-buffer gnus-save-article-buffer) | 3958 | (let ((article (gnus-summary-article-number)) |
| 3959 | (default (or gnus-summary-pipe-output-default-command | 3959 | (decode (unless raw |
| 3960 | gnus-last-shell-command))) | 3960 | (get 'gnus-summary-save-in-pipe :decode))) |
| 3961 | ;; `gnus-save-article-buffer' should be a buffer containing the article | 3961 | save-buffer default) |
| 3962 | ;; contents if this function is called by way of the command | 3962 | (if article |
| 3963 | ;; `gnus-summary-pipe-output'. OTOH, that the buffer does not exist | 3963 | (if (vectorp (gnus-summary-article-header article)) |
| 3964 | ;; means this function is called independently. | 3964 | (save-current-buffer |
| 3965 | (unless (gnus-buffer-live-p save-buffer) | 3965 | (gnus-summary-select-article decode decode nil article) |
| 3966 | (let ((article (gnus-summary-article-number)) | 3966 | (insert-buffer-substring |
| 3967 | (decode (unless raw | 3967 | (prog1 |
| 3968 | (get 'gnus-summary-save-in-pipe :decode)))) | 3968 | (if decode |
| 3969 | (if article | 3969 | gnus-article-buffer |
| 3970 | (if (vectorp (gnus-summary-article-header article)) | 3970 | gnus-original-article-buffer) |
| 3971 | (save-window-excursion | 3971 | (setq save-buffer |
| 3972 | (let ((gnus-display-mime-function | 3972 | (nnheader-set-temp-buffer " *Gnus Save*")))) |
| 3973 | (when decode | 3973 | ;; Remove unwanted headers. |
| 3974 | gnus-display-mime-function)) | 3974 | (when (and (not raw) |
| 3975 | (gnus-article-prepare-hook | 3975 | (or (get 'gnus-summary-save-in-pipe :headers) |
| 3976 | (when decode | 3976 | (not gnus-save-all-headers))) |
| 3977 | gnus-article-prepare-hook))) | 3977 | (let ((gnus-visible-headers |
| 3978 | (gnus-summary-select-article t t nil article) | 3978 | (or (symbol-value (get 'gnus-summary-save-in-pipe |
| 3979 | (gnus-summary-goto-subject article)) | 3979 | :headers)) |
| 3980 | (insert-buffer-substring | 3980 | gnus-saved-headers gnus-visible-headers)) |
| 3981 | (prog1 | 3981 | (gnus-summary-buffer nil)) |
| 3982 | (if decode | 3982 | (article-hide-headers 1 t)))) |
| 3983 | gnus-article-buffer | 3983 | (error "%d is not a real article" article)) |
| 3984 | gnus-original-article-buffer) | 3984 | (error "No article to pipe")) |
| 3985 | (setq save-buffer | 3985 | (setq default (or gnus-summary-pipe-output-default-command |
| 3986 | (nnheader-set-temp-buffer " *Gnus Save*")))) | 3986 | gnus-last-shell-command)) |
| 3987 | ;; Remove unwanted headers. | ||
| 3988 | (when (and (not raw) | ||
| 3989 | (or (get 'gnus-summary-save-in-pipe :headers) | ||
| 3990 | (not gnus-save-all-headers))) | ||
| 3991 | (let ((gnus-visible-headers | ||
| 3992 | (or (symbol-value (get 'gnus-summary-save-in-pipe | ||
| 3993 | :headers)) | ||
| 3994 | gnus-saved-headers gnus-visible-headers)) | ||
| 3995 | (gnus-summary-buffer nil)) | ||
| 3996 | (article-hide-headers 1 t)))) | ||
| 3997 | (error "%d is not a real article" article)) | ||
| 3998 | (error "No article to pipe")))) | ||
| 3999 | (unless (stringp command) | 3987 | (unless (stringp command) |
| 4000 | (setq command | 3988 | (setq command |
| 4001 | (if (and (eq command 'default) default) | 3989 | (if (and (eq command 'default) default) |
| 4002 | default | 3990 | default |
| 4003 | (gnus-read-shell-command | 3991 | (gnus-read-shell-command "Shell command on this article: " |
| 4004 | (format | 3992 | default)))) |
| 4005 | "Shell command on %s: " | ||
| 4006 | (if (and gnus-number-of-articles-to-be-saved | ||
| 4007 | (> gnus-number-of-articles-to-be-saved 1)) | ||
| 4008 | (format "these %d articles" | ||
| 4009 | gnus-number-of-articles-to-be-saved) | ||
| 4010 | "this article")) | ||
| 4011 | default)))) | ||
| 4012 | (when (string-equal command "") | 3993 | (when (string-equal command "") |
| 4013 | (if default | 3994 | (if default |
| 4014 | (setq command default) | 3995 | (setq command default) |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 7efd9d7595c..edec081f2ce 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -1825,12 +1825,14 @@ increase the score of each group you read." | |||
| 1825 | "?" gnus-summary-mark-as-dormant | 1825 | "?" gnus-summary-mark-as-dormant |
| 1826 | "\C-c\M-\C-s" gnus-summary-limit-include-expunged | 1826 | "\C-c\M-\C-s" gnus-summary-limit-include-expunged |
| 1827 | "\C-c\C-s\C-n" gnus-summary-sort-by-number | 1827 | "\C-c\C-s\C-n" gnus-summary-sort-by-number |
| 1828 | "\C-c\C-s\C-m\C-n" gnus-summary-sort-by-most-recent-number | ||
| 1828 | "\C-c\C-s\C-l" gnus-summary-sort-by-lines | 1829 | "\C-c\C-s\C-l" gnus-summary-sort-by-lines |
| 1829 | "\C-c\C-s\C-c" gnus-summary-sort-by-chars | 1830 | "\C-c\C-s\C-c" gnus-summary-sort-by-chars |
| 1830 | "\C-c\C-s\C-a" gnus-summary-sort-by-author | 1831 | "\C-c\C-s\C-a" gnus-summary-sort-by-author |
| 1831 | "\C-c\C-s\C-t" gnus-summary-sort-by-recipient | 1832 | "\C-c\C-s\C-t" gnus-summary-sort-by-recipient |
| 1832 | "\C-c\C-s\C-s" gnus-summary-sort-by-subject | 1833 | "\C-c\C-s\C-s" gnus-summary-sort-by-subject |
| 1833 | "\C-c\C-s\C-d" gnus-summary-sort-by-date | 1834 | "\C-c\C-s\C-d" gnus-summary-sort-by-date |
| 1835 | "\C-c\C-s\C-m\C-d" gnus-summary-sort-by-most-recent-date | ||
| 1834 | "\C-c\C-s\C-i" gnus-summary-sort-by-score | 1836 | "\C-c\C-s\C-i" gnus-summary-sort-by-score |
| 1835 | "\C-c\C-s\C-o" gnus-summary-sort-by-original | 1837 | "\C-c\C-s\C-o" gnus-summary-sort-by-original |
| 1836 | "\C-c\C-s\C-r" gnus-summary-sort-by-random | 1838 | "\C-c\C-s\C-r" gnus-summary-sort-by-random |
| @@ -2703,10 +2705,12 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) | |||
| 2703 | ["Pop article off history" gnus-summary-pop-article t]) | 2705 | ["Pop article off history" gnus-summary-pop-article t]) |
| 2704 | ("Sort" | 2706 | ("Sort" |
| 2705 | ["Sort by number" gnus-summary-sort-by-number t] | 2707 | ["Sort by number" gnus-summary-sort-by-number t] |
| 2708 | ["Sort by most recent number" gnus-summary-sort-by-most-recent-number t] | ||
| 2706 | ["Sort by author" gnus-summary-sort-by-author t] | 2709 | ["Sort by author" gnus-summary-sort-by-author t] |
| 2707 | ["Sort by recipient" gnus-summary-sort-by-recipient t] | 2710 | ["Sort by recipient" gnus-summary-sort-by-recipient t] |
| 2708 | ["Sort by subject" gnus-summary-sort-by-subject t] | 2711 | ["Sort by subject" gnus-summary-sort-by-subject t] |
| 2709 | ["Sort by date" gnus-summary-sort-by-date t] | 2712 | ["Sort by date" gnus-summary-sort-by-date t] |
| 2713 | ["Sort by most recent date" gnus-summary-sort-by-most-recent-date t] | ||
| 2710 | ["Sort by score" gnus-summary-sort-by-score t] | 2714 | ["Sort by score" gnus-summary-sort-by-score t] |
| 2711 | ["Sort by lines" gnus-summary-sort-by-lines t] | 2715 | ["Sort by lines" gnus-summary-sort-by-lines t] |
| 2712 | ["Sort by characters" gnus-summary-sort-by-chars t] | 2716 | ["Sort by characters" gnus-summary-sort-by-chars t] |
| @@ -11467,6 +11471,12 @@ Argument REVERSE means reverse order." | |||
| 11467 | (interactive "P") | 11471 | (interactive "P") |
| 11468 | (gnus-summary-sort 'number reverse)) | 11472 | (gnus-summary-sort 'number reverse)) |
| 11469 | 11473 | ||
| 11474 | (defun gnus-summary-sort-by-most-recent-number (&optional reverse) | ||
| 11475 | "Sort the summary buffer by most recent article number. | ||
| 11476 | Argument REVERSE means reverse order." | ||
| 11477 | (interactive "P") | ||
| 11478 | (gnus-summary-sort 'most-recent-number reverse)) | ||
| 11479 | |||
| 11470 | (defun gnus-summary-sort-by-random (&optional reverse) | 11480 | (defun gnus-summary-sort-by-random (&optional reverse) |
| 11471 | "Randomize the order in the summary buffer. | 11481 | "Randomize the order in the summary buffer. |
| 11472 | Argument REVERSE means to randomize in reverse order." | 11482 | Argument REVERSE means to randomize in reverse order." |
| @@ -11500,6 +11510,12 @@ Argument REVERSE means reverse order." | |||
| 11500 | (interactive "P") | 11510 | (interactive "P") |
| 11501 | (gnus-summary-sort 'date reverse)) | 11511 | (gnus-summary-sort 'date reverse)) |
| 11502 | 11512 | ||
| 11513 | (defun gnus-summary-sort-by-most-recent-date (&optional reverse) | ||
| 11514 | "Sort the summary buffer by most recent date. | ||
| 11515 | Argument REVERSE means reverse order." | ||
| 11516 | (interactive "P") | ||
| 11517 | (gnus-summary-sort 'most-recent-date reverse)) | ||
| 11518 | |||
| 11503 | (defun gnus-summary-sort-by-score (&optional reverse) | 11519 | (defun gnus-summary-sort-by-score (&optional reverse) |
| 11504 | "Sort the summary buffer by score. | 11520 | "Sort the summary buffer by score. |
| 11505 | Argument REVERSE means reverse order." | 11521 | Argument REVERSE means reverse order." |
| @@ -11613,29 +11629,69 @@ will not be marked as saved." | |||
| 11613 | (gnus-set-mode-line 'summary) | 11629 | (gnus-set-mode-line 'summary) |
| 11614 | n)) | 11630 | n)) |
| 11615 | 11631 | ||
| 11616 | (defun gnus-summary-pipe-output (&optional arg headers) | 11632 | (defun gnus-summary-pipe-output (&optional n sym) |
| 11617 | "Pipe the current article to a subprocess. | 11633 | "Pipe the current article to a subprocess. |
| 11618 | If N is a positive number, pipe the N next articles. | 11634 | If N is a positive number, pipe the N next articles. |
| 11619 | If N is a negative number, pipe the N previous articles. | 11635 | If N is a negative number, pipe the N previous articles. |
| 11620 | If N is nil and any articles have been marked with the process mark, | 11636 | If N is nil and any articles have been marked with the process mark, |
| 11621 | pipe those articles instead. | 11637 | pipe those articles instead. |
| 11622 | If HEADERS (the symbolic prefix) is given, force including all headers." | 11638 | The default command to which articles are piped is specified by the |
| 11639 | variable `gnus-summary-pipe-output-default-command'; if it is nil, you | ||
| 11640 | will be prompted for the command. | ||
| 11641 | |||
| 11642 | The properties `:decode' and `:headers' that are put to the function | ||
| 11643 | symbol `gnus-summary-save-in-pipe' control whether this function | ||
| 11644 | decodes articles and what headers to keep (see the doc string for the | ||
| 11645 | `gnus-default-article-saver' variable). If SYM (the symbolic prefix) | ||
| 11646 | is neither omitted nor the symbol `r', force including all headers | ||
| 11647 | regardless of the `:headers' property. If it is the symbol `r', | ||
| 11648 | articles that are not decoded and include all headers will be piped | ||
| 11649 | no matter what the properties `:decode' and `:headers' are." | ||
| 11623 | (interactive (gnus-interactive "P\ny")) | 11650 | (interactive (gnus-interactive "P\ny")) |
| 11624 | (require 'gnus-art) | 11651 | (require 'gnus-art) |
| 11625 | (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe)) | 11652 | (let* ((articles (gnus-summary-work-articles n)) |
| 11626 | (if headers | 11653 | (result-buffer "*Shell Command Output*") |
| 11627 | (let ((gnus-save-all-headers t) | 11654 | (all-headers (not (memq sym '(nil r)))) |
| 11628 | (headers (get gnus-default-article-saver :headers))) | 11655 | (gnus-save-all-headers (or all-headers gnus-save-all-headers)) |
| 11629 | (unwind-protect | 11656 | (raw (eq sym 'r)) |
| 11630 | (progn | 11657 | (headers (get 'gnus-summary-save-in-pipe :headers)) |
| 11631 | (put gnus-default-article-saver :headers nil) | 11658 | command result) |
| 11632 | (gnus-summary-save-article arg t)) | 11659 | (unless (numberp (car articles)) |
| 11633 | (put gnus-default-article-saver :headers headers))) | 11660 | (error "No article to pipe")) |
| 11634 | (gnus-summary-save-article arg t))) | 11661 | (setq command (gnus-read-shell-command |
| 11635 | (let ((buffer (get-buffer "*Shell Command Output*"))) | 11662 | (concat "Shell command on " |
| 11636 | (when (and buffer | 11663 | (if (cdr articles) |
| 11637 | (not (zerop (buffer-size buffer)))) | 11664 | (format "these %d articles" (length articles)) |
| 11638 | (gnus-configure-windows 'pipe)))) | 11665 | "this article") |
| 11666 | ": ") | ||
| 11667 | gnus-summary-pipe-output-default-command)) | ||
| 11668 | (when (string-equal command "") | ||
| 11669 | (error "A command is required")) | ||
| 11670 | (when all-headers | ||
| 11671 | (put 'gnus-summary-save-in-pipe :headers nil)) | ||
| 11672 | (unwind-protect | ||
| 11673 | (while articles | ||
| 11674 | (gnus-summary-goto-subject (pop articles)) | ||
| 11675 | (save-window-excursion (gnus-summary-save-in-pipe command raw)) | ||
| 11676 | (when (and (get-buffer result-buffer) | ||
| 11677 | (not (zerop (buffer-size (get-buffer result-buffer))))) | ||
| 11678 | (setq result (concat result (with-current-buffer result-buffer | ||
| 11679 | (buffer-string)))))) | ||
| 11680 | (put 'gnus-summary-save-in-pipe :headers headers)) | ||
| 11681 | (unless (zerop (length result)) | ||
| 11682 | (if (with-current-buffer (get-buffer-create result-buffer) | ||
| 11683 | (erase-buffer) | ||
| 11684 | (insert result) | ||
| 11685 | (prog1 | ||
| 11686 | (and (= (count-lines (point-min) (point)) 1) | ||
| 11687 | (progn | ||
| 11688 | (end-of-line 0) | ||
| 11689 | (<= (current-column) | ||
| 11690 | (window-width (minibuffer-window))))) | ||
| 11691 | (goto-char (point-min)))) | ||
| 11692 | (message "%s" (substring result 0 -1)) | ||
| 11693 | (message nil) | ||
| 11694 | (gnus-configure-windows 'pipe))))) | ||
| 11639 | 11695 | ||
| 11640 | (defun gnus-summary-save-article-mail (&optional arg) | 11696 | (defun gnus-summary-save-article-mail (&optional arg) |
| 11641 | "Append the current article to a Unix mail box file. | 11697 | "Append the current article to a Unix mail box file. |
diff --git a/lisp/gnus/rfc2104.el b/lisp/gnus/rfc2104.el index af6ebd5a80c..0339d5983a2 100644 --- a/lisp/gnus/rfc2104.el +++ b/lisp/gnus/rfc2104.el | |||
| @@ -85,6 +85,14 @@ | |||
| 85 | (setq ls (cdr ls))) | 85 | (setq ls (cdr ls))) |
| 86 | v)) | 86 | v)) |
| 87 | 87 | ||
| 88 | (eval-when-compile | ||
| 89 | (defmacro rfc2104-string-make-unibyte (string) | ||
| 90 | "Return the unibyte equivalent of STRING. | ||
| 91 | In XEmacs return just STRING." | ||
| 92 | (if (featurep 'xemacs) | ||
| 93 | string | ||
| 94 | `(string-make-unibyte ,string)))) | ||
| 95 | |||
| 88 | (defun rfc2104-hash (hash block-length hash-length key text) | 96 | (defun rfc2104-hash (hash block-length hash-length key text) |
| 89 | (let* (;; if key is longer than B, reset it to HASH(key) | 97 | (let* (;; if key is longer than B, reset it to HASH(key) |
| 90 | (key (if (> (length key) block-length) | 98 | (key (if (> (length key) block-length) |
| @@ -100,7 +108,8 @@ | |||
| 100 | (aset ipad i (logxor rfc2104-ipad c)) | 108 | (aset ipad i (logxor rfc2104-ipad c)) |
| 101 | (aset opad i (logxor rfc2104-opad c))) | 109 | (aset opad i (logxor rfc2104-opad c))) |
| 102 | ;; Perform inner hash. | 110 | ;; Perform inner hash. |
| 103 | (setq partial (string-make-unibyte (funcall hash (concat ipad text)))) | 111 | (setq partial (rfc2104-string-make-unibyte |
| 112 | (funcall hash (concat ipad text)))) | ||
| 104 | ;; Pack latter part of opad. | 113 | ;; Pack latter part of opad. |
| 105 | (do ((r 0 (+ 2 r)) | 114 | (do ((r 0 (+ 2 r)) |
| 106 | (w block-length (1+ w))) | 115 | (w block-length (1+ w))) |
| @@ -109,7 +118,7 @@ | |||
| 109 | (+ (* 16 (aref rfc2104-nybbles (aref partial r))) | 118 | (+ (* 16 (aref rfc2104-nybbles (aref partial r))) |
| 110 | ( aref rfc2104-nybbles (aref partial (1+ r)))))) | 119 | ( aref rfc2104-nybbles (aref partial (1+ r)))))) |
| 111 | ;; Perform outer hash. | 120 | ;; Perform outer hash. |
| 112 | (string-make-unibyte (funcall hash opad)))) | 121 | (rfc2104-string-make-unibyte (funcall hash opad)))) |
| 113 | 122 | ||
| 114 | (provide 'rfc2104) | 123 | (provide 'rfc2104) |
| 115 | 124 | ||