diff options
| author | Miles Bader | 2007-12-16 04:31:33 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-12-16 04:31:33 +0000 |
| commit | bbbe940b6d5834189ea6d48d70a2e8f113cf53e9 (patch) | |
| tree | 066e474ab26c558dee63239298f1b9a5441cef77 | |
| parent | 30361feeba69e643550298efc507822a769b8c00 (diff) | |
| download | emacs-bbbe940b6d5834189ea6d48d70a2e8f113cf53e9.tar.gz emacs-bbbe940b6d5834189ea6d48d70a2e8f113cf53e9.zip | |
Merge from gnus--devo--0
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-955
| -rw-r--r-- | doc/misc/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/misc/gnus.texi | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 39 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 124 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 10 | ||||
| -rw-r--r-- | lisp/gnus/gnus-util.el | 26 | ||||
| -rw-r--r-- | lisp/gnus/mm-decode.el | 31 | ||||
| -rw-r--r-- | lisp/pgg.el | 32 |
9 files changed, 185 insertions, 87 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 89e4974490d..8e4eab56b15 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2007-12-14 Sven Joachim <svenjoac@gmx.de> | ||
| 2 | |||
| 3 | * gnus.texi (Score Variables): Fix typo. | ||
| 4 | |||
| 1 | 2007-12-07 Michael Albinus <michael.albinus@gmx.de> | 5 | 2007-12-07 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 6 | ||
| 3 | * dbus.texi (Synchronous Methods): Adapt dbus-call-method. | 7 | * dbus.texi (Synchronous Methods): Adapt dbus-call-method. |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 8ec39ce81fe..4a165c62b25 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -20529,7 +20529,7 @@ Suffix to add to the group name to arrive at the score file name | |||
| 20529 | @vindex gnus-score-uncacheable-files | 20529 | @vindex gnus-score-uncacheable-files |
| 20530 | @cindex score cache | 20530 | @cindex score cache |
| 20531 | All score files are normally cached to avoid excessive re-loading of | 20531 | All score files are normally cached to avoid excessive re-loading of |
| 20532 | score files. However, if this might make your Emacs grow big and | 20532 | score files. However, this might make your Emacs grow big and |
| 20533 | bloated, so this regexp can be used to weed out score files unlikely | 20533 | bloated, so this regexp can be used to weed out score files unlikely |
| 20534 | to be needed again. It would be a bad idea to deny caching of | 20534 | to be needed again. It would be a bad idea to deny caching of |
| 20535 | @file{all.SCORE}, while it might be a good idea to not cache | 20535 | @file{all.SCORE}, while it might be a good idea to not cache |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fffb1e03f60..fb82a128413 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -18,6 +18,10 @@ | |||
| 18 | * calc/calc.el (calc-set-mode-line): Use `math-lang-name' | 18 | * calc/calc.el (calc-set-mode-line): Use `math-lang-name' |
| 19 | to set language name. | 19 | to set language name. |
| 20 | 20 | ||
| 21 | 2007-12-10 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 22 | |||
| 23 | * pgg.el (pgg-run-at-time, pgg-cancel-timer): Use eval-and-compile. | ||
| 24 | |||
| 21 | 2007-12-10 Stefan Monnier <monnier@iro.umontreal.ca> | 25 | 2007-12-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 22 | 26 | ||
| 23 | * server.el (server-select-display): Fix important typo. | 27 | * server.el (server-select-display): Fix important typo. |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index cda28979cb1..d8bb4876269 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,38 @@ | |||
| 1 | 2007-12-15 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2 | |||
| 3 | * gnus-art.el (article-verify-x-pgp-sig): Add reference to X-PGP-Sig | ||
| 4 | format document. | ||
| 5 | (gnus-mime-delete-part): Don't write description line if empty. | ||
| 6 | (gnus-article-encrypt-body): Add confirmation for gnus-novice-user. | ||
| 7 | |||
| 8 | 2007-12-14 Johan Bockg,Ae(Brd <bojohan@gnu.org> | ||
| 9 | |||
| 10 | * gnus-sum.el (gnus-summary-mark-unread-as-read) | ||
| 11 | (gnus-summary-mark-read-and-unread-as-read) | ||
| 12 | (gnus-summary-mark-current-read-and-unread-as-read) | ||
| 13 | (gnus-summary-mark-unread-as-ticked): Doc fix. | ||
| 14 | `gnus-mark-article-hook', not `gnus-summary-mark-article-hook'. | ||
| 15 | |||
| 16 | 2007-12-14 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 17 | |||
| 18 | * gnus-sum.el (gnus-summary-prev-article): Fix doc string. Reported by | ||
| 19 | Christoph Conrad <christoph.conrad@gmx.de>. | ||
| 20 | |||
| 21 | 2007-12-14 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 22 | |||
| 23 | * gnus-util.el (gnus-y-or-n-p, gnus-yes-or-no-p): Alias to y-or-n-p and | ||
| 24 | yes-or-no-p. | ||
| 25 | |||
| 26 | 2007-12-11 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 27 | |||
| 28 | * mm-decode.el (mm-add-meta-html-tag): New function. | ||
| 29 | (mm-save-part-to-file, mm-pipe-part): Use it | ||
| 30 | |||
| 31 | * gnus-art.el (gnus-article-browse-delete-temp-files): Use | ||
| 32 | gnus-y-or-n-p instead of y-or-n-p. | ||
| 33 | (gnus-article-browse-html-parts): Work with message/external-body; use | ||
| 34 | mm-add-meta-html-tag. | ||
| 35 | |||
| 1 | 2007-12-11 Glenn Morris <rgm@gnu.org> | 36 | 2007-12-11 Glenn Morris <rgm@gnu.org> |
| 2 | 37 | ||
| 3 | * gnus-cache.el: Require gnus-sum not just when compiling. | 38 | * gnus-cache.el: Require gnus-sum not just when compiling. |
| @@ -74,6 +109,10 @@ | |||
| 74 | * spam.el (gnus-extract-address-components): | 109 | * spam.el (gnus-extract-address-components): |
| 75 | Declare as functions. | 110 | Declare as functions. |
| 76 | 111 | ||
| 112 | 2007-12-10 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 113 | |||
| 114 | * gnus-art.el (gnus-article-browse-html-parts): Decode CTE. | ||
| 115 | |||
| 77 | 2007-12-09 Glenn Morris <rgm@gnu.org> | 116 | 2007-12-09 Glenn Morris <rgm@gnu.org> |
| 78 | 117 | ||
| 79 | * gnus-uu.el (gnus-uu-yenc-article): Use insert-buffer-substring. | 118 | * gnus-uu.el (gnus-uu-yenc-article): Use insert-buffer-substring. |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index d8f03ff2cb8..e984372543d 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -2782,9 +2782,9 @@ summary buffer." | |||
| 2782 | (or how | 2782 | (or how |
| 2783 | (setq how gnus-article-browse-delete-temp))) | 2783 | (setq how gnus-article-browse-delete-temp))) |
| 2784 | (when (and (eq how 'ask) | 2784 | (when (and (eq how 'ask) |
| 2785 | (y-or-n-p (format | 2785 | (gnus-y-or-n-p (format |
| 2786 | "Delete all %s temporary HTML file(s)? " | 2786 | "Delete all %s temporary HTML file(s)? " |
| 2787 | (length gnus-article-browse-html-temp-list))) | 2787 | (length gnus-article-browse-html-temp-list))) |
| 2788 | (setq how t))) | 2788 | (setq how t))) |
| 2789 | (dolist (file gnus-article-browse-html-temp-list) | 2789 | (dolist (file gnus-article-browse-html-temp-list) |
| 2790 | (when (and (file-exists-p file) | 2790 | (when (and (file-exists-p file) |
| @@ -2802,61 +2802,63 @@ summary buffer." | |||
| 2802 | "View all \"text/html\" parts from LIST. | 2802 | "View all \"text/html\" parts from LIST. |
| 2803 | Recurse into multiparts." | 2803 | Recurse into multiparts." |
| 2804 | ;; Internal function used by `gnus-article-browse-html-article'. | 2804 | ;; Internal function used by `gnus-article-browse-html-article'. |
| 2805 | (let ((showed)) | 2805 | (let (type file charset tmp-file showed) |
| 2806 | ;; Find and show the html-parts. | 2806 | ;; Find and show the html-parts. |
| 2807 | (dolist (handle list) | 2807 | (dolist (handle list) |
| 2808 | ;; If HTML, show it: | 2808 | ;; If HTML, show it: |
| 2809 | (when (listp handle) | 2809 | (cond ((not (listp handle))) |
| 2810 | (cond ((and (bufferp (car handle)) | 2810 | ((or (equal (car (setq type (mm-handle-type handle))) "text/html") |
| 2811 | (string-match "text/html" (car (mm-handle-type handle)))) | 2811 | (and (equal (car type) "message/external-body") |
| 2812 | (let ((tmp-file (mm-make-temp-file | 2812 | (setq file (or (mail-content-type-get type 'name) |
| 2813 | ;; Do we need to care for 8.3 filenames? | 2813 | (mail-content-type-get |
| 2814 | "mm-" nil ".html")) | 2814 | (mm-handle-disposition handle) |
| 2815 | (charset (mail-content-type-get (mm-handle-type handle) | 2815 | 'filename))) |
| 2816 | 'charset))) | 2816 | (or (mm-handle-cache handle) |
| 2817 | (if charset | 2817 | (condition-case code |
| 2818 | ;; Add a meta html tag to specify charset. | 2818 | (progn (mm-extern-cache-contents handle) t) |
| 2819 | (mm-with-unibyte-buffer | 2819 | (error |
| 2820 | (insert (with-current-buffer (mm-handle-buffer handle) | 2820 | (gnus-message 3 "%s" (error-message-string code)) |
| 2821 | (if (eq charset 'gnus-decoded) | 2821 | (when (>= gnus-verbose 3) (sit-for 2)) |
| 2822 | (mm-encode-coding-string | 2822 | nil))) |
| 2823 | (buffer-string) | 2823 | (progn |
| 2824 | (setq charset 'utf-8)) | 2824 | (setq handle (mm-handle-cache handle) |
| 2825 | (buffer-string)))) | 2825 | type (mm-handle-type handle)) |
| 2826 | (setq charset (format "\ | 2826 | (equal (car type) "text/html")))) |
| 2827 | <meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">" | 2827 | (when (or (setq charset (mail-content-type-get type 'charset)) |
| 2828 | charset)) | 2828 | (not file)) |
| 2829 | (goto-char (point-min)) | 2829 | (setq tmp-file (mm-make-temp-file |
| 2830 | (let ((case-fold-search t)) | 2830 | ;; Do we need to care for 8.3 filenames? |
| 2831 | (cond (;; Don't modify existing meta tag. | 2831 | "mm-" nil ".html"))) |
| 2832 | (re-search-forward "\ | 2832 | (if charset |
| 2833 | <meta[\t\n\r ]+http-equiv=\"content-type\"[^>]+>" | 2833 | ;; Add a meta html tag to specify charset. |
| 2834 | nil t)) | 2834 | (mm-with-unibyte-buffer |
| 2835 | ((re-search-forward "<head>[\t\n\r ]*" nil t) | 2835 | (insert (if (eq charset 'gnus-decoded) |
| 2836 | (insert charset "\n")) | 2836 | (mm-encode-coding-string (mm-get-part handle) |
| 2837 | (t | 2837 | (setq charset 'utf-8)) |
| 2838 | (re-search-forward "\ | 2838 | (mm-get-part handle))) |
| 2839 | <html\\(?:[\t\n\r ]+[^>]+\\|[\t\n\r ]*\\)>[\t\n\r ]*" | 2839 | (if (or (mm-add-meta-html-tag handle charset) |
| 2840 | nil t) | 2840 | (not file)) |
| 2841 | (insert "<head>\n" charset "\n</head>\n")))) | ||
| 2842 | (mm-write-region (point-min) (point-max) | 2841 | (mm-write-region (point-min) (point-max) |
| 2843 | tmp-file nil nil nil 'binary t)) | 2842 | tmp-file nil nil nil 'binary t) |
| 2844 | (mm-save-part-to-file handle tmp-file)) | 2843 | (setq tmp-file nil))) |
| 2845 | (add-to-list 'gnus-article-browse-html-temp-list tmp-file) | 2844 | (when tmp-file |
| 2846 | (add-hook 'gnus-summary-prepare-exit-hook | 2845 | (mm-save-part-to-file handle tmp-file))) |
| 2847 | 'gnus-article-browse-delete-temp-files) | 2846 | (when tmp-file |
| 2848 | (add-hook 'gnus-exit-gnus-hook | 2847 | (add-to-list 'gnus-article-browse-html-temp-list tmp-file)) |
| 2849 | (lambda () | 2848 | (add-hook 'gnus-summary-prepare-exit-hook |
| 2850 | (gnus-article-browse-delete-temp-files t))) | 2849 | 'gnus-article-browse-delete-temp-files) |
| 2851 | ;; FIXME: Warn if there's an <img> tag? | 2850 | (add-hook 'gnus-exit-gnus-hook |
| 2852 | (browse-url-of-file tmp-file) | 2851 | (lambda () |
| 2853 | (setq showed t))) | 2852 | (gnus-article-browse-delete-temp-files t))) |
| 2854 | ;; If multipart, recurse | 2853 | ;; FIXME: Warn if there's an <img> tag? |
| 2855 | ((and (stringp (car handle)) | 2854 | (browse-url-of-file (or tmp-file (expand-file-name file))) |
| 2856 | (string-match "^multipart/" (car handle)) | 2855 | (setq showed t)) |
| 2857 | (setq showed | 2856 | ;; If multipart, recurse |
| 2858 | (or showed | 2857 | ((and (stringp (car handle)) |
| 2859 | (gnus-article-browse-html-parts handle)))))))) | 2858 | (string-match "^multipart/" (car handle)) |
| 2859 | (setq showed | ||
| 2860 | (or showed | ||
| 2861 | (gnus-article-browse-html-parts handle))))))) | ||
| 2860 | showed)) | 2862 | showed)) |
| 2861 | 2863 | ||
| 2862 | ;; FIXME: Documentation in texi/gnus.texi missing. | 2864 | ;; FIXME: Documentation in texi/gnus.texi missing. |
| @@ -3916,6 +3918,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is | |||
| 3916 | 3918 | ||
| 3917 | (defun article-verify-x-pgp-sig () | 3919 | (defun article-verify-x-pgp-sig () |
| 3918 | "Verify X-PGP-Sig." | 3920 | "Verify X-PGP-Sig." |
| 3921 | ;; <ftp://ftp.isc.org/pub/pgpcontrol/FORMAT> | ||
| 3919 | (interactive) | 3922 | (interactive) |
| 3920 | (if (gnus-buffer-live-p gnus-original-article-buffer) | 3923 | (if (gnus-buffer-live-p gnus-original-article-buffer) |
| 3921 | (let ((sig (with-current-buffer gnus-original-article-buffer | 3924 | (let ((sig (with-current-buffer gnus-original-article-buffer |
| @@ -4724,8 +4727,9 @@ Deleting parts may malfunction or destroy the article; continue? ")) | |||
| 4724 | (handles gnus-article-mime-handles) | 4727 | (handles gnus-article-mime-handles) |
| 4725 | (none "(none)") | 4728 | (none "(none)") |
| 4726 | (description | 4729 | (description |
| 4727 | (mail-decode-encoded-word-string (or (mm-handle-description data) | 4730 | (let ((desc (mm-handle-description data))) |
| 4728 | none))) | 4731 | (when desc |
| 4732 | (mail-decode-encoded-word-string desc)))) | ||
| 4729 | (filename | 4733 | (filename |
| 4730 | (or (mail-content-type-get (mm-handle-disposition data) 'filename) | 4734 | (or (mail-content-type-get (mm-handle-disposition data) 'filename) |
| 4731 | none)) | 4735 | none)) |
| @@ -4743,7 +4747,8 @@ Deleting parts may malfunction or destroy the article; continue? ")) | |||
| 4743 | "| Type: " type "\n" | 4747 | "| Type: " type "\n" |
| 4744 | "| Filename: " filename "\n" | 4748 | "| Filename: " filename "\n" |
| 4745 | "| Size (encoded): " bsize " Byte\n" | 4749 | "| Size (encoded): " bsize " Byte\n" |
| 4746 | "| Description: " description "\n" | 4750 | (when description |
| 4751 | (concat "| Description: " description "\n")) | ||
| 4747 | "`----\n")) | 4752 | "`----\n")) |
| 4748 | (setcdr data | 4753 | (setcdr data |
| 4749 | (cdr (mm-make-handle | 4754 | (cdr (mm-make-handle |
| @@ -8003,6 +8008,11 @@ For example: | |||
| 8003 | gnus-article-encrypt-protocol-alist | 8008 | gnus-article-encrypt-protocol-alist |
| 8004 | nil t)) | 8009 | nil t)) |
| 8005 | current-prefix-arg)) | 8010 | current-prefix-arg)) |
| 8011 | ;; User might hit `K E' instead of `K e', so prompt once. | ||
| 8012 | (when (and gnus-article-encrypt-protocol | ||
| 8013 | gnus-novice-user) | ||
| 8014 | (unless (gnus-y-or-n-p "Really encrypt article(s)? ") | ||
| 8015 | (error "Encrypt aborted."))) | ||
| 8006 | (let ((func (cdr (assoc protocol gnus-article-encrypt-protocol-alist)))) | 8016 | (let ((func (cdr (assoc protocol gnus-article-encrypt-protocol-alist)))) |
| 8007 | (unless func | 8017 | (unless func |
| 8008 | (error "Can't find the encrypt protocol %s" protocol)) | 8018 | (error "Can't find the encrypt protocol %s" protocol)) |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 2f4ccb7307c..62068d85a80 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -7658,7 +7658,7 @@ If BACKWARD, the previous article is selected instead of the next." | |||
| 7658 | (gnus-summary-article-subject)))) | 7658 | (gnus-summary-article-subject)))) |
| 7659 | 7659 | ||
| 7660 | (defun gnus-summary-prev-article (&optional unread subject) | 7660 | (defun gnus-summary-prev-article (&optional unread subject) |
| 7661 | "Select the article after the current one. | 7661 | "Select the article before the current one. |
| 7662 | If UNREAD is non-nil, only unread articles are selected." | 7662 | If UNREAD is non-nil, only unread articles are selected." |
| 7663 | (interactive "P") | 7663 | (interactive "P") |
| 7664 | (gnus-summary-next-article unread subject t)) | 7664 | (gnus-summary-next-article unread subject t)) |
| @@ -10830,12 +10830,12 @@ The difference between N and the number of marks cleared is returned." | |||
| 10830 | (gnus-summary-mark-forward (- n) gnus-unread-mark)) | 10830 | (gnus-summary-mark-forward (- n) gnus-unread-mark)) |
| 10831 | 10831 | ||
| 10832 | (defun gnus-summary-mark-unread-as-read () | 10832 | (defun gnus-summary-mark-unread-as-read () |
| 10833 | "Intended to be used by `gnus-summary-mark-article-hook'." | 10833 | "Intended to be used by `gnus-mark-article-hook'." |
| 10834 | (when (memq gnus-current-article gnus-newsgroup-unreads) | 10834 | (when (memq gnus-current-article gnus-newsgroup-unreads) |
| 10835 | (gnus-summary-mark-article gnus-current-article gnus-read-mark))) | 10835 | (gnus-summary-mark-article gnus-current-article gnus-read-mark))) |
| 10836 | 10836 | ||
| 10837 | (defun gnus-summary-mark-read-and-unread-as-read (&optional new-mark) | 10837 | (defun gnus-summary-mark-read-and-unread-as-read (&optional new-mark) |
| 10838 | "Intended to be used by `gnus-summary-mark-article-hook'." | 10838 | "Intended to be used by `gnus-mark-article-hook'." |
| 10839 | (let ((mark (gnus-summary-article-mark))) | 10839 | (let ((mark (gnus-summary-article-mark))) |
| 10840 | (when (or (gnus-unread-mark-p mark) | 10840 | (when (or (gnus-unread-mark-p mark) |
| 10841 | (gnus-read-mark-p mark)) | 10841 | (gnus-read-mark-p mark)) |
| @@ -10843,7 +10843,7 @@ The difference between N and the number of marks cleared is returned." | |||
| 10843 | (or new-mark gnus-read-mark))))) | 10843 | (or new-mark gnus-read-mark))))) |
| 10844 | 10844 | ||
| 10845 | (defun gnus-summary-mark-current-read-and-unread-as-read (&optional new-mark) | 10845 | (defun gnus-summary-mark-current-read-and-unread-as-read (&optional new-mark) |
| 10846 | "Intended to be used by `gnus-summary-mark-article-hook'." | 10846 | "Intended to be used by `gnus-mark-article-hook'." |
| 10847 | (let ((mark (gnus-summary-article-mark))) | 10847 | (let ((mark (gnus-summary-article-mark))) |
| 10848 | (when (or (gnus-unread-mark-p mark) | 10848 | (when (or (gnus-unread-mark-p mark) |
| 10849 | (gnus-read-mark-p mark)) | 10849 | (gnus-read-mark-p mark)) |
| @@ -10851,7 +10851,7 @@ The difference between N and the number of marks cleared is returned." | |||
| 10851 | (or new-mark gnus-read-mark))))) | 10851 | (or new-mark gnus-read-mark))))) |
| 10852 | 10852 | ||
| 10853 | (defun gnus-summary-mark-unread-as-ticked () | 10853 | (defun gnus-summary-mark-unread-as-ticked () |
| 10854 | "Intended to be used by `gnus-summary-mark-article-hook'." | 10854 | "Intended to be used by `gnus-mark-article-hook'." |
| 10855 | (when (memq gnus-current-article gnus-newsgroup-unreads) | 10855 | (when (memq gnus-current-article gnus-newsgroup-unreads) |
| 10856 | (gnus-summary-mark-article gnus-current-article gnus-ticked-mark))) | 10856 | (gnus-summary-mark-article gnus-current-article gnus-ticked-mark))) |
| 10857 | 10857 | ||
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 7b36c07da62..56aacf0d5a6 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el | |||
| @@ -337,15 +337,23 @@ Symbols are also allowed; their print names are used instead." | |||
| 337 | 337 | ||
| 338 | ;; Two silly functions to ensure that all `y-or-n-p' questions clear | 338 | ;; Two silly functions to ensure that all `y-or-n-p' questions clear |
| 339 | ;; the echo area. | 339 | ;; the echo area. |
| 340 | (defun gnus-y-or-n-p (prompt) | 340 | ;; |
| 341 | (prog1 | 341 | ;; Do we really need these aliases? Workarounds for bugs in the corresponding |
| 342 | (y-or-n-p prompt) | 342 | ;; Emacs functions? Maybe these bug are no longer present in any supported |
| 343 | (message ""))) | 343 | ;; (X)Emacs version? Alias them to the original functions and see if anyone |
| 344 | 344 | ;; reports a problem. If not, replace with original functions. --rsteib | |
| 345 | (defun gnus-yes-or-no-p (prompt) | 345 | ;; |
| 346 | (prog1 | 346 | ;; (defun gnus-y-or-n-p (prompt) |
| 347 | (yes-or-no-p prompt) | 347 | ;; (prog1 |
| 348 | (message ""))) | 348 | ;; (y-or-n-p prompt) |
| 349 | ;; (message ""))) | ||
| 350 | ;; (defun gnus-yes-or-no-p (prompt) | ||
| 351 | ;; (prog1 | ||
| 352 | ;; (yes-or-no-p prompt) | ||
| 353 | ;; (message ""))) | ||
| 354 | |||
| 355 | (defalias 'gnus-y-or-n-p 'y-or-n-p) | ||
| 356 | (defalias 'gnus-yes-or-no-p 'yes-or-no-p) | ||
| 349 | 357 | ||
| 350 | ;; By Frank Schmitt <ich@Frank-Schmitt.net>. Allows to have | 358 | ;; By Frank Schmitt <ich@Frank-Schmitt.net>. Allows to have |
| 351 | ;; age-depending date representations. (e.g. just the time if it's | 359 | ;; age-depending date representations. (e.g. just the time if it's |
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 9de9b3d354e..e2c23d9db5a 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el | |||
| @@ -1239,9 +1239,39 @@ PROMPT overrides the default one used to ask user for a file name." | |||
| 1239 | (mm-save-part-to-file handle file) | 1239 | (mm-save-part-to-file handle file) |
| 1240 | file)))) | 1240 | file)))) |
| 1241 | 1241 | ||
| 1242 | (defun mm-add-meta-html-tag (handle &optional charset) | ||
| 1243 | "Add meta html tag to specify CHARSET of HANDLE in the current buffer. | ||
| 1244 | CHARSET defaults to the one HANDLE specifies. Existing meta tag that | ||
| 1245 | specifies charset will not be modified. Return t if meta tag is added | ||
| 1246 | or replaced." | ||
| 1247 | (when (equal (mm-handle-media-type handle) "text/html") | ||
| 1248 | (when (or charset | ||
| 1249 | (setq charset (mail-content-type-get (mm-handle-type handle) | ||
| 1250 | 'charset))) | ||
| 1251 | (setq charset (format "\ | ||
| 1252 | <meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">" charset)) | ||
| 1253 | (let ((case-fold-search t)) | ||
| 1254 | (goto-char (point-min)) | ||
| 1255 | (if (re-search-forward "\ | ||
| 1256 | <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']\ | ||
| 1257 | text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+?\\)\\)?[\"'][^>]*>" nil t) | ||
| 1258 | (if (and (match-beginning 2) | ||
| 1259 | (string-match "\\`html\\'" (match-string 1))) | ||
| 1260 | ;; Don't modify existing meta tag. | ||
| 1261 | nil | ||
| 1262 | ;; Replace it with the one specifying charset. | ||
| 1263 | (replace-match charset) | ||
| 1264 | t) | ||
| 1265 | (if (re-search-forward "<head>\\s-*" nil t) | ||
| 1266 | (insert charset "\n") | ||
| 1267 | (re-search-forward "<html\\(?:\\s-+[^>]+\\|\\s-*\\)>\\s-*" nil t) | ||
| 1268 | (insert "<head>\n" charset "\n</head>\n")) | ||
| 1269 | t))))) | ||
| 1270 | |||
| 1242 | (defun mm-save-part-to-file (handle file) | 1271 | (defun mm-save-part-to-file (handle file) |
| 1243 | (mm-with-unibyte-buffer | 1272 | (mm-with-unibyte-buffer |
| 1244 | (mm-insert-part handle) | 1273 | (mm-insert-part handle) |
| 1274 | (mm-add-meta-html-tag handle) | ||
| 1245 | (let ((current-file-modes (default-file-modes))) | 1275 | (let ((current-file-modes (default-file-modes))) |
| 1246 | (set-default-file-modes mm-attachment-file-modes) | 1276 | (set-default-file-modes mm-attachment-file-modes) |
| 1247 | (unwind-protect | 1277 | (unwind-protect |
| @@ -1258,6 +1288,7 @@ PROMPT overrides the default one used to ask user for a file name." | |||
| 1258 | (read-string "Shell command on MIME part: " mm-last-shell-command))) | 1288 | (read-string "Shell command on MIME part: " mm-last-shell-command))) |
| 1259 | (mm-with-unibyte-buffer | 1289 | (mm-with-unibyte-buffer |
| 1260 | (mm-insert-part handle) | 1290 | (mm-insert-part handle) |
| 1291 | (mm-add-meta-html-tag handle) | ||
| 1261 | (let ((coding-system-for-write 'binary)) | 1292 | (let ((coding-system-for-write 'binary)) |
| 1262 | (shell-command-on-region (point-min) (point-max) command nil))))) | 1293 | (shell-command-on-region (point-min) (point-max) command nil))))) |
| 1263 | 1294 | ||
diff --git a/lisp/pgg.el b/lisp/pgg.el index 74b6ed7cb22..26911974ea6 100644 --- a/lisp/pgg.el +++ b/lisp/pgg.el | |||
| @@ -42,12 +42,10 @@ | |||
| 42 | ;;; | 42 | ;;; |
| 43 | 43 | ||
| 44 | (eval-when-compile | 44 | (eval-when-compile |
| 45 | (unless (featurep 'xemacs) | 45 | ;; Define it as a null macro for Emacs in order to suppress a byte |
| 46 | (defalias 'pgg-run-at-time 'run-at-time) | 46 | ;; compile warning that Emacs 21 issues. |
| 47 | (defalias 'pgg-cancel-timer 'cancel-timer)) | 47 | (defmacro pgg-run-at-time-1 (time repeat function args) |
| 48 | 48 | (when (featurep 'xemacs) | |
| 49 | (when (featurep 'xemacs) | ||
| 50 | (defmacro pgg-run-at-time-1 (time repeat function args) | ||
| 51 | (if (condition-case nil | 49 | (if (condition-case nil |
| 52 | (let ((delete-itimer 'delete-itimer) | 50 | (let ((delete-itimer 'delete-itimer) |
| 53 | (itimer-driver-start 'itimer-driver-start) | 51 | (itimer-driver-start 'itimer-driver-start) |
| @@ -105,19 +103,23 @@ | |||
| 105 | itimer | 103 | itimer |
| 106 | (append (list itimer function) args))))) | 104 | (append (list itimer function) args))))) |
| 107 | 1e-9 (if time (max time 1e-9) 1e-9) | 105 | 1e-9 (if time (max time 1e-9) 1e-9) |
| 108 | nil t itimers ,repeat ,function ,args)))) | 106 | nil t itimers ,repeat ,function ,args)))))) |
| 109 | 107 | ||
| 110 | (defun pgg-run-at-time (time repeat function &rest args) | 108 | (eval-and-compile |
| 111 | "Emulating function run as `run-at-time'. | 109 | (if (featurep 'xemacs) |
| 110 | (progn | ||
| 111 | (defun pgg-run-at-time (time repeat function &rest args) | ||
| 112 | "Emulating function run as `run-at-time'. | ||
| 112 | TIME should be nil meaning now, or a number of seconds from now. | 113 | TIME should be nil meaning now, or a number of seconds from now. |
| 113 | Return an itimer object which can be used in either `delete-itimer' | 114 | Return an itimer object which can be used in either `delete-itimer' |
| 114 | or `cancel-timer'." | 115 | or `cancel-timer'." |
| 115 | (pgg-run-at-time-1 time repeat function args)) | 116 | (pgg-run-at-time-1 time repeat function args)) |
| 116 | (defun pgg-cancel-timer (timer) | 117 | (defun pgg-cancel-timer (timer) |
| 117 | "Emulate cancel-timer for xemacs." | 118 | "Emulate cancel-timer for xemacs." |
| 118 | (let ((delete-itimer 'delete-itimer)) | 119 | (let ((delete-itimer 'delete-itimer)) |
| 119 | (funcall delete-itimer timer))) | 120 | (funcall delete-itimer timer)))) |
| 120 | )) | 121 | (defalias 'pgg-run-at-time 'run-at-time) |
| 122 | (defalias 'pgg-cancel-timer 'cancel-timer))) | ||
| 121 | 123 | ||
| 122 | (defun pgg-invoke (func scheme &rest args) | 124 | (defun pgg-invoke (func scheme &rest args) |
| 123 | (progn | 125 | (progn |