aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-06-01 05:07:06 +0000
committerMiles Bader2005-06-01 05:07:06 +0000
commit4a43ee9b90f6b3c65affab1c1ebb158af5bc7141 (patch)
tree1cce37871d0aca763d0673f3b4342c658f757aaa
parent9ccee7d041a4e7f820572d7cc191abe0c3eb7181 (diff)
downloademacs-4a43ee9b90f6b3c65affab1c1ebb158af5bc7141.tar.gz
emacs-4a43ee9b90f6b3c65affab1c1ebb158af5bc7141.zip
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-345
Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 77-78) - Update from CVS 2005-05-31 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-art.el (article-display-x-face): Replace process-kill-without-query by gnus-set-process-query-on-exit-flag. * lisp/gnus/gnus-group.el: Bind gnus-cache-active-hashtb when compiling. * lisp/gnus/gnus-util.el (gnus-set-process-query-on-exit-flag): Alias to set-process-query-on-exit-flag or process-kill-without-query. * lisp/gnus/html2text.el (html2text-fix-paragraphs): Use `while - re-search' loop instead of replace-regexp. * lisp/gnus/imap.el (imap-ssl-open): Use set-process-query-on-exit-flag instead of process-kill-without-query if it is available. * lisp/gnus/mm-util.el (mm-insert-file-contents): Bind find-file-hook instead of find-file-hooks if it is available. * lisp/gnus/mml1991.el: Bind pgg-default-user-id when compiling. * lisp/gnus/mml2015.el: Bind pgg-default-user-id when compiling. * lisp/gnus/nndraft.el (nndraft-request-associate-buffer): Use write-contents-functions instead of write-contents-hooks if it is available. * lisp/gnus/nnheader.el (nnheader-find-file-noselect): Bind find-file-hook instead of find-file-hooks if it is available. * lisp/gnus/nntp.el (nntp-open-connection): Replace process-kill-without-query by gnus-set-process-query-on-exit-flag. (nntp-open-ssl-stream): Ditto. (nntp-open-tls-stream): Ditto. * lisp/gnus/pgg.el: Don't bind itimer vars; don't autoload itimer functions. (pgg-run-at-time-1): New macro. (pgg-run-at-time): Use it. * lisp/gnus/starttls.el (starttls-set-process-query-on-exit-flag): Alias to set-process-query-on-exit-flag or process-kill-without-query. (starttls-open-stream-gnutls): Use it instead of process-kill-without-query. (starttls-open-stream): Ditto. 2005-05-31 Simon Josefsson <jas@extundo.com> * lisp/gnus/imap.el (imap-ssl-open): Use imap-process-connection-type, instead of hard coding to nil. 2005-05-31 Kevin Greiner <kgreiner@xpediantsolutions.com> * lisp/gnus/gnus-group.el (): Require gnus-sum and autoload functions to resolve warnings when gnus-group.el compiled alone.
-rw-r--r--lisp/gnus/ChangeLog55
-rw-r--r--lisp/gnus/gnus-art.el5
-rw-r--r--lisp/gnus/gnus-group.el6
-rw-r--r--lisp/gnus/gnus-util.el5
-rw-r--r--lisp/gnus/html2text.el5
-rw-r--r--lisp/gnus/imap.el8
-rw-r--r--lisp/gnus/mm-util.el38
-rw-r--r--lisp/gnus/mml1991.el9
-rw-r--r--lisp/gnus/mml2015.el4
-rw-r--r--lisp/gnus/nndraft.el9
-rw-r--r--lisp/gnus/nnheader.el26
-rw-r--r--lisp/gnus/nntp.el6
-rw-r--r--lisp/gnus/pgg.el138
-rw-r--r--lisp/gnus/starttls.el13
14 files changed, 209 insertions, 118 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 1f8f23bbf18..089261f108c 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,58 @@
12005-05-31 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-art.el (article-display-x-face): Replace
4 process-kill-without-query by gnus-set-process-query-on-exit-flag.
5
6 * gnus-group.el: Bind gnus-cache-active-hashtb when compiling.
7
8 * gnus-util.el (gnus-set-process-query-on-exit-flag): Alias to
9 set-process-query-on-exit-flag or process-kill-without-query.
10
11 * html2text.el (html2text-fix-paragraphs): Use `while - re-search'
12 loop instead of replace-regexp.
13
14 * imap.el (imap-ssl-open): Use set-process-query-on-exit-flag
15 instead of process-kill-without-query if it is available.
16
17 * mm-util.el (mm-insert-file-contents): Bind find-file-hook
18 instead of find-file-hooks if it is available.
19
20 * mml1991.el: Bind pgg-default-user-id when compiling.
21
22 * mml2015.el: Bind pgg-default-user-id when compiling.
23
24 * nndraft.el (nndraft-request-associate-buffer): Use
25 write-contents-functions instead of write-contents-hooks if it is
26 available.
27
28 * nnheader.el (nnheader-find-file-noselect): Bind find-file-hook
29 instead of find-file-hooks if it is available.
30
31 * nntp.el (nntp-open-connection): Replace
32 process-kill-without-query by gnus-set-process-query-on-exit-flag.
33 (nntp-open-ssl-stream): Ditto.
34 (nntp-open-tls-stream): Ditto.
35
36 * pgg.el: Don't bind itimer vars; don't autoload itimer functions.
37 (pgg-run-at-time-1): New macro.
38 (pgg-run-at-time): Use it.
39
40 * starttls.el (starttls-set-process-query-on-exit-flag): Alias to
41 set-process-query-on-exit-flag or process-kill-without-query.
42 (starttls-open-stream-gnutls): Use it instead of
43 process-kill-without-query.
44 (starttls-open-stream): Ditto.
45
462005-05-31 Simon Josefsson <jas@extundo.com>
47
48 * imap.el (imap-ssl-open): Use imap-process-connection-type,
49 instead of hard coding to nil.
50
512005-05-31 Kevin Greiner <kgreiner@xpediantsolutions.com>
52
53 * gnus-group.el (): Require gnus-sum and autoload functions to
54 resolve warnings when gnus-group.el compiled alone.
55
12005-05-30 Reiner Steib <Reiner.Steib@gmx.de> 562005-05-30 Reiner Steib <Reiner.Steib@gmx.de>
2 57
3 * gnus-agent.el (gnus-agent-regenerate-group) 58 * gnus-agent.el (gnus-agent-regenerate-group)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index c3076cbb22e..4af363c6b2e 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -2181,10 +2181,11 @@ unfolded."
2181 ;; The command is a string, so we interpret the command 2181 ;; The command is a string, so we interpret the command
2182 ;; as a, well, command, and fork it off. 2182 ;; as a, well, command, and fork it off.
2183 (let ((process-connection-type nil)) 2183 (let ((process-connection-type nil))
2184 (process-kill-without-query 2184 (gnus-set-process-query-on-exit-flag
2185 (start-process 2185 (start-process
2186 "article-x-face" nil shell-file-name 2186 "article-x-face" nil shell-file-name
2187 shell-command-switch gnus-article-x-face-command)) 2187 shell-command-switch gnus-article-x-face-command)
2188 nil)
2188 (with-temp-buffer 2189 (with-temp-buffer
2189 (insert face) 2190 (insert face)
2190 (process-send-region "article-x-face" 2191 (process-send-region "article-x-face"
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 578e74d2a0e..f1343d9dbd3 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -41,7 +41,11 @@
41(require 'time-date) 41(require 'time-date)
42(require 'gnus-ems) 42(require 'gnus-ems)
43 43
44(eval-when-compile (require 'mm-url)) 44(eval-when-compile
45 (require 'mm-url)
46 (let ((features (cons 'gnus-group features)))
47 (require 'gnus-sum))
48 (defvar gnus-cache-active-hashtb))
45 49
46(defcustom gnus-group-archive-directory 50(defcustom gnus-group-archive-directory
47 "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/" 51 "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 0f92c1fc189..6171d42834e 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1571,6 +1571,11 @@ empty directories from OLD-PATH."
1571 (file-truename 1571 (file-truename
1572 (concat old-dir ".."))))))))) 1572 (concat old-dir "..")))))))))
1573 1573
1574(if (fboundp 'set-process-query-on-exit-flag)
1575 (defalias 'gnus-set-process-query-on-exit-flag
1576 'set-process-query-on-exit-flag)
1577 (defalias 'gnus-set-process-query-on-exit-flag
1578 'process-kill-without-query))
1574 1579
1575(provide 'gnus-util) 1580(provide 'gnus-util)
1576 1581
diff --git a/lisp/gnus/html2text.el b/lisp/gnus/html2text.el
index ef05af9bae6..81d8f5d8cc3 100644
--- a/lisp/gnus/html2text.el
+++ b/lisp/gnus/html2text.el
@@ -1,5 +1,5 @@
1;;; html2text.el --- a simple html to plain text converter 1;;; html2text.el --- a simple html to plain text converter
2;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 2;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4;; Author: Joakim Hove <hove@phys.ntnu.no> 4;; Author: Joakim Hove <hove@phys.ntnu.no>
5 5
@@ -374,7 +374,8 @@ formatting, and then moved afterward.")
374fashion, quite close to pure guess-work. It does work in some cases though." 374fashion, quite close to pure guess-work. It does work in some cases though."
375 (interactive) 375 (interactive)
376 (goto-char (point-min)) 376 (goto-char (point-min))
377 (replace-regexp "^<br>$" "") 377 (while (re-search-forward "^<br>$" nil t)
378 (delete-region (match-beginning 0) (match-end 0)))
378 ;; Removing lonely <br> on a single line, if they are left intact we 379 ;; Removing lonely <br> on a single line, if they are left intact we
379 ;; dont have any paragraphs at all. 380 ;; dont have any paragraphs at all.
380 (goto-char (point-min)) 381 (goto-char (point-min))
diff --git a/lisp/gnus/imap.el b/lisp/gnus/imap.el
index c7f9d60339f..48d7c0f6eb6 100644
--- a/lisp/gnus/imap.el
+++ b/lisp/gnus/imap.el
@@ -640,7 +640,11 @@ sure of changing the value of `foo'."
640 (let* ((port (or port imap-default-ssl-port)) 640 (let* ((port (or port imap-default-ssl-port))
641 (coding-system-for-read imap-coding-system-for-read) 641 (coding-system-for-read imap-coding-system-for-read)
642 (coding-system-for-write imap-coding-system-for-write) 642 (coding-system-for-write imap-coding-system-for-write)
643 (process-connection-type nil) 643 (process-connection-type imap-process-connection-type)
644 (set-process-query-on-exit-flag
645 (if (fboundp 'set-process-query-on-exit-flag)
646 'set-process-query-on-exit-flag
647 'process-kill-without-query))
644 process) 648 process)
645 (when (progn 649 (when (progn
646 (setq process (start-process 650 (setq process (start-process
@@ -650,7 +654,7 @@ sure of changing the value of `foo'."
650 (format-spec-make 654 (format-spec-make
651 ?s server 655 ?s server
652 ?p (number-to-string port))))) 656 ?p (number-to-string port)))))
653 (process-kill-without-query process) 657 (funcall set-process-query-on-exit-flag process nil)
654 process) 658 process)
655 (with-current-buffer buffer 659 (with-current-buffer buffer
656 (goto-char (point-min)) 660 (goto-char (point-min))
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 6fe69f2edd5..069cdb7f70c 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -889,22 +889,28 @@ to advanced Emacs features, such as file-name-handlers, format decoding,
889`find-file-hooks', etc. 889`find-file-hooks', etc.
890If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'. 890If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'.
891 This function ensures that none of these modifications will take place." 891 This function ensures that none of these modifications will take place."
892 (let ((format-alist nil) 892 (let* ((format-alist nil)
893 (auto-mode-alist (if inhibit nil (mm-auto-mode-alist))) 893 (auto-mode-alist (if inhibit nil (mm-auto-mode-alist)))
894 (default-major-mode 'fundamental-mode) 894 (default-major-mode 'fundamental-mode)
895 (enable-local-variables nil) 895 (enable-local-variables nil)
896 (after-insert-file-functions nil) 896 (after-insert-file-functions nil)
897 (enable-local-eval nil) 897 (enable-local-eval nil)
898 (find-file-hooks nil) 898 (inhibit-file-name-operation (if inhibit
899 (inhibit-file-name-operation (if inhibit 899 'insert-file-contents
900 'insert-file-contents 900 inhibit-file-name-operation))
901 inhibit-file-name-operation)) 901 (inhibit-file-name-handlers
902 (inhibit-file-name-handlers 902 (if inhibit
903 (if inhibit 903 (append mm-inhibit-file-name-handlers
904 (append mm-inhibit-file-name-handlers 904 inhibit-file-name-handlers)
905 inhibit-file-name-handlers) 905 inhibit-file-name-handlers))
906 inhibit-file-name-handlers))) 906 (ffh (if (boundp 'find-file-hook)
907 (insert-file-contents filename visit beg end replace))) 907 'find-file-hook
908 'find-file-hooks))
909 (val (symbol-value ffh)))
910 (set ffh nil)
911 (unwind-protect
912 (insert-file-contents filename visit beg end replace)
913 (set ffh val))))
908 914
909(defun mm-append-to-file (start end filename &optional codesys inhibit) 915(defun mm-append-to-file (start end filename &optional codesys inhibit)
910 "Append the contents of the region to the end of file FILENAME. 916 "Append the contents of the region to the end of file FILENAME.
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 14d52e45ce4..640348c1387 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -1,5 +1,6 @@
1;;; mml1991.el --- Old PGP message format (RFC 1991) support for MML 1;;; mml1991.el --- Old PGP message format (RFC 1991) support for MML
2;; Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. 2;; Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005
3;; Free Software Foundation, Inc.
3 4
4;; Author: Sascha Lüdecke <sascha@meta-x.de>, 5;; Author: Sascha Lüdecke <sascha@meta-x.de>,
5;; Simon Josefsson <simon@josefsson.org> (Mailcrypt interface, Gnus glue) 6;; Simon Josefsson <simon@josefsson.org> (Mailcrypt interface, Gnus glue)
@@ -219,8 +220,10 @@
219 220
220;; pgg wrapper 221;; pgg wrapper
221 222
222(defvar pgg-output-buffer) 223(eval-when-compile
223(defvar pgg-errors-buffer) 224 (defvar pgg-default-user-id)
225 (defvar pgg-errors-buffer)
226 (defvar pgg-output-buffer))
224 227
225(defun mml1991-pgg-sign (cont) 228(defun mml1991-pgg-sign (cont)
226 (let (headers cte) 229 (let (headers cte)
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index a0e47dd2f2c..5f53d87bfef 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -1,5 +1,6 @@
1;;; mml2015.el --- MIME Security with Pretty Good Privacy (PGP) 1;;; mml2015.el --- MIME Security with Pretty Good Privacy (PGP)
2;; Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 2;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
3;; Free Software Foundation, Inc.
3 4
4;; Author: Shenghuo Zhu <zsh@cs.rochester.edu> 5;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
5;; Keywords: PGP MIME MML 6;; Keywords: PGP MIME MML
@@ -632,6 +633,7 @@
632;;; pgg wrapper 633;;; pgg wrapper
633 634
634(eval-when-compile 635(eval-when-compile
636 (defvar pgg-default-user-id)
635 (defvar pgg-errors-buffer) 637 (defvar pgg-errors-buffer)
636 (defvar pgg-output-buffer)) 638 (defvar pgg-output-buffer))
637 639
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el
index a71376155c1..2fc65868b9c 100644
--- a/lisp/gnus/nndraft.el
+++ b/lisp/gnus/nndraft.el
@@ -1,6 +1,6 @@
1;;; nndraft.el --- draft article access for Gnus 1;;; nndraft.el --- draft article access for Gnus
2 2
3;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 3;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -174,8 +174,11 @@
174 (setq buffer-file-name (expand-file-name file) 174 (setq buffer-file-name (expand-file-name file)
175 buffer-auto-save-file-name (make-auto-save-file-name)) 175 buffer-auto-save-file-name (make-auto-save-file-name))
176 (clear-visited-file-modtime) 176 (clear-visited-file-modtime)
177 (make-local-variable 'write-contents-hooks) 177 (let ((hook (if (boundp 'write-contents-functions)
178 (push 'nndraft-generate-headers write-contents-hooks) 178 'write-contents-functions
179 'write-contents-hooks)))
180 (gnus-make-local-hook hook)
181 (add-hook hook 'nndraft-generate-headers nil t))
179 article)) 182 article))
180 183
181(deffoo nndraft-request-group (group &optional server dont-check) 184(deffoo nndraft-request-group (group &optional server dont-check)
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index c55252e5b64..952d936bd0d 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -1,7 +1,7 @@
1;;; nnheader.el --- header access macros for Gnus and its backends 1;;; nnheader.el --- header access macros for Gnus and its backends
2 2
3;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996, 3;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996,
4;; 1997, 1998, 2000, 2001, 2002, 2003, 2004 4;; 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
5;; Free Software Foundation, Inc. 5;; Free Software Foundation, Inc.
6 6
7;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> 7;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -953,15 +953,21 @@ find-file-hooks, etc.
953(defun nnheader-find-file-noselect (&rest args) 953(defun nnheader-find-file-noselect (&rest args)
954 "Open a file with some variables bound. 954 "Open a file with some variables bound.
955See `find-file-noselect' for the arguments." 955See `find-file-noselect' for the arguments."
956 (let ((format-alist nil) 956 (let* ((format-alist nil)
957 (auto-mode-alist (mm-auto-mode-alist)) 957 (auto-mode-alist (mm-auto-mode-alist))
958 (default-major-mode 'fundamental-mode) 958 (default-major-mode 'fundamental-mode)
959 (enable-local-variables nil) 959 (enable-local-variables nil)
960 (after-insert-file-functions nil) 960 (after-insert-file-functions nil)
961 (enable-local-eval nil) 961 (enable-local-eval nil)
962 (find-file-hooks nil) 962 (coding-system-for-read nnheader-file-coding-system)
963 (coding-system-for-read nnheader-file-coding-system)) 963 (ffh (if (boundp 'find-file-hook)
964 (apply 'find-file-noselect args))) 964 'find-file-hook
965 'find-file-hooks))
966 (val (symbol-value ffh)))
967 (set ffh nil)
968 (unwind-protect
969 (apply 'find-file-noselect args)
970 (set ffh val))))
965 971
966(defun nnheader-directory-regular-files (dir) 972(defun nnheader-directory-regular-files (dir)
967 "Return a list of all regular files in DIR." 973 "Return a list of all regular files in DIR."
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 1c964a5706c..888a6edcfb1 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1128,7 +1128,7 @@ password contained in '~/.nntp-authinfo'."
1128 (nntp-kill-buffer pbuffer)) 1128 (nntp-kill-buffer pbuffer))
1129 (when (and (buffer-name pbuffer) 1129 (when (and (buffer-name pbuffer)
1130 process) 1130 process)
1131 (process-kill-without-query process) 1131 (gnus-set-process-query-on-exit-flag process nil)
1132 (if (and (nntp-wait-for process "^2.*\n" buffer nil t) 1132 (if (and (nntp-wait-for process "^2.*\n" buffer nil t)
1133 (memq (process-status process) '(open run))) 1133 (memq (process-status process) '(open run)))
1134 (prog1 1134 (prog1
@@ -1162,7 +1162,7 @@ password contained in '~/.nntp-authinfo'."
1162 (format-spec-make 1162 (format-spec-make
1163 ?s nntp-address 1163 ?s nntp-address
1164 ?p nntp-port-number))))) 1164 ?p nntp-port-number)))))
1165 (process-kill-without-query proc) 1165 (gnus-set-process-query-on-exit-flag proc nil)
1166 (save-excursion 1166 (save-excursion
1167 (set-buffer buffer) 1167 (set-buffer buffer)
1168 (let ((nntp-connection-alist (list proc buffer nil))) 1168 (let ((nntp-connection-alist (list proc buffer nil)))
@@ -1173,7 +1173,7 @@ password contained in '~/.nntp-authinfo'."
1173 1173
1174(defun nntp-open-tls-stream (buffer) 1174(defun nntp-open-tls-stream (buffer)
1175 (let ((proc (open-tls-stream "nntpd" buffer nntp-address nntp-port-number))) 1175 (let ((proc (open-tls-stream "nntpd" buffer nntp-address nntp-port-number)))
1176 (process-kill-without-query proc) 1176 (gnus-set-process-query-on-exit-flag proc nil)
1177 (save-excursion 1177 (save-excursion
1178 (set-buffer buffer) 1178 (set-buffer buffer)
1179 (let ((nntp-connection-alist (list proc buffer nil))) 1179 (let ((nntp-connection-alist (list proc buffer nil)))
diff --git a/lisp/gnus/pgg.el b/lisp/gnus/pgg.el
index 888219a8c57..eff02a1c32a 100644
--- a/lisp/gnus/pgg.el
+++ b/lisp/gnus/pgg.el
@@ -1,6 +1,6 @@
1;;; pgg.el --- glue for the various PGP implementations. 1;;; pgg.el --- glue for the various PGP implementations.
2 2
3;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Daiki Ueno <ueno@unixuser.org> 5;; Author: Daiki Ueno <ueno@unixuser.org>
6;; Created: 1999/10/28 6;; Created: 1999/10/28
@@ -97,82 +97,76 @@
97 (read-passwd prompt))) 97 (read-passwd prompt)))
98 98
99(eval-when-compile 99(eval-when-compile
100 (defvar itimer-process) 100 (defmacro pgg-run-at-time-1 (time repeat function args)
101 (defvar itimer-timer) 101 (when (featurep 'xemacs)
102 (autoload 'delete-itimer "itimer") 102 (if (condition-case nil
103 (autoload 'itimer-driver-start "itimer") 103 (let ((delete-itimer 'delete-itimer)
104 (autoload 'itimer-value "itimer") 104 (itimer-driver-start 'itimer-driver-start)
105 (autoload 'set-itimer-function "itimer") 105 (itimer-value 'itimer-value)
106 (autoload 'set-itimer-function-arguments "itimer") 106 (start-itimer 'start-itimer))
107 (autoload 'set-itimer-restart "itimer") 107 (unless (or (symbol-value 'itimer-process)
108 (autoload 'start-itimer "itimer")) 108 (symbol-value 'itimer-timer))
109 (funcall itimer-driver-start))
110 ;; Check whether there is a bug to which the difference of
111 ;; the present time and the time when the itimer driver was
112 ;; woken up is subtracted from the initial itimer value.
113 (let* ((inhibit-quit t)
114 (ctime (current-time))
115 (itimer-timer-last-wakeup
116 (prog1
117 ctime
118 (setcar ctime (1- (car ctime)))))
119 (itimer-list nil)
120 (itimer (funcall start-itimer "pgg-run-at-time"
121 'ignore 5)))
122 (sleep-for 0.1) ;; Accept the timeout interrupt.
123 (prog1
124 (> (funcall itimer-value itimer) 0)
125 (funcall delete-itimer itimer))))
126 (error nil))
127 `(let ((time ,time))
128 (apply #'start-itimer "pgg-run-at-time"
129 ,function (if time (max time 1e-9) 1e-9)
130 ,repeat nil t ,args)))
131 `(let ((time ,time)
132 (itimers (list nil)))
133 (setcar
134 itimers
135 (apply #'start-itimer "pgg-run-at-time"
136 (lambda (itimers repeat function &rest args)
137 (let ((itimer (car itimers)))
138 (if repeat
139 (progn
140 (set-itimer-function
141 itimer
142 (lambda (itimer repeat function &rest args)
143 (set-itimer-restart itimer repeat)
144 (set-itimer-function itimer function)
145 (set-itimer-function-arguments itimer args)
146 (apply function args)))
147 (set-itimer-function-arguments
148 itimer
149 (append (list itimer repeat function) args)))
150 (set-itimer-function
151 itimer
152 (lambda (itimer function &rest args)
153 (delete-itimer itimer)
154 (apply function args)))
155 (set-itimer-function-arguments
156 itimer
157 (append (list itimer function) args)))))
158 1e-9 (if time (max time 1e-9) 1e-9)
159 nil t itimers ,repeat ,function ,args))))))
109 160
110(eval-and-compile 161(eval-and-compile
111 (defalias 162 (if (featurep 'xemacs)
112 'pgg-run-at-time 163 (defun pgg-run-at-time (time repeat function &rest args)
113 (if (featurep 'xemacs) 164 "Emulating function run as `run-at-time'.
114 (if (condition-case nil
115 (progn
116 (unless (or itimer-process itimer-timer)
117 (itimer-driver-start))
118 ;; Check whether there is a bug to which the difference of
119 ;; the present time and the time when the itimer driver was
120 ;; woken up is subtracted from the initial itimer value.
121 (let* ((inhibit-quit t)
122 (ctime (current-time))
123 (itimer-timer-last-wakeup
124 (prog1
125 ctime
126 (setcar ctime (1- (car ctime)))))
127 (itimer-list nil)
128 (itimer (start-itimer "pgg-run-at-time" 'ignore 5)))
129 (sleep-for 0.1) ;; Accept the timeout interrupt.
130 (prog1
131 (> (itimer-value itimer) 0)
132 (delete-itimer itimer))))
133 (error nil))
134 (lambda (time repeat function &rest args)
135 "Emulating function run as `run-at-time'.
136TIME should be nil meaning now, or a number of seconds from now. 165TIME should be nil meaning now, or a number of seconds from now.
137Return an itimer object which can be used in either `delete-itimer' 166Return an itimer object which can be used in either `delete-itimer'
138or `cancel-timer'." 167or `cancel-timer'."
139 (apply #'start-itimer "pgg-run-at-time" 168 (pgg-run-at-time-1 time repeat function args))
140 function (if time (max time 1e-9) 1e-9) 169 (defalias 'pgg-run-at-time 'run-at-time)))
141 repeat nil t args))
142 (lambda (time repeat function &rest args)
143 "Emulating function run as `run-at-time' in the right way.
144TIME should be nil meaning now, or a number of seconds from now.
145Return an itimer object which can be used in either `delete-itimer'
146or `cancel-timer'."
147 (let ((itimers (list nil)))
148 (setcar
149 itimers
150 (apply #'start-itimer "pgg-run-at-time"
151 (lambda (itimers repeat function &rest args)
152 (let ((itimer (car itimers)))
153 (if repeat
154 (progn
155 (set-itimer-function
156 itimer
157 (lambda (itimer repeat function &rest args)
158 (set-itimer-restart itimer repeat)
159 (set-itimer-function itimer function)
160 (set-itimer-function-arguments itimer args)
161 (apply function args)))
162 (set-itimer-function-arguments
163 itimer
164 (append (list itimer repeat function) args)))
165 (set-itimer-function
166 itimer
167 (lambda (itimer function &rest args)
168 (delete-itimer itimer)
169 (apply function args)))
170 (set-itimer-function-arguments
171 itimer
172 (append (list itimer function) args)))))
173 1e-9 (if time (max time 1e-9) 1e-9)
174 nil t itimers repeat function args)))))
175 'run-at-time)))
176 170
177(defun pgg-add-passphrase-cache (key passphrase) 171(defun pgg-add-passphrase-cache (key passphrase)
178 (setq key (pgg-truncate-key-identifier key)) 172 (setq key (pgg-truncate-key-identifier key))
diff --git a/lisp/gnus/starttls.el b/lisp/gnus/starttls.el
index f2b72fbef1c..7faa3a933a7 100644
--- a/lisp/gnus/starttls.el
+++ b/lisp/gnus/starttls.el
@@ -1,6 +1,7 @@
1;;; starttls.el --- STARTTLS functions 1;;; starttls.el --- STARTTLS functions
2 2
3;; Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Daiki Ueno <ueno@unixuser.org> 6;; Author: Daiki Ueno <ueno@unixuser.org>
6;; Author: Simon Josefsson <simon@josefsson.org> 7;; Author: Simon Josefsson <simon@josefsson.org>
@@ -235,6 +236,12 @@ handshake, or NIL on failure."
235 (starttls-negotiate-gnutls process) 236 (starttls-negotiate-gnutls process)
236 (signal-process (process-id process) 'SIGALRM))) 237 (signal-process (process-id process) 'SIGALRM)))
237 238
239(if (fboundp 'set-process-query-on-exit-flag)
240 (defalias 'starttls-set-process-query-on-exit-flag
241 'set-process-query-on-exit-flag)
242 (defalias 'starttls-set-process-query-on-exit-flag
243 'process-kill-without-query))
244
238(defun starttls-open-stream-gnutls (name buffer host service) 245(defun starttls-open-stream-gnutls (name buffer host service)
239 (message "Opening STARTTLS connection to `%s'..." host) 246 (message "Opening STARTTLS connection to `%s'..." host)
240 (let* (done 247 (let* (done
@@ -246,7 +253,7 @@ handshake, or NIL on failure."
246 (int-to-string service) 253 (int-to-string service)
247 service) 254 service)
248 starttls-extra-arguments))) 255 starttls-extra-arguments)))
249 (process-kill-without-query process) 256 (starttls-set-process-query-on-exit-flag process nil)
250 (while (and (processp process) 257 (while (and (processp process)
251 (eq (process-status process) 'run) 258 (eq (process-status process) 'run)
252 (save-excursion 259 (save-excursion
@@ -286,7 +293,7 @@ specifying a port number to connect to."
286 name buffer starttls-program 293 name buffer starttls-program
287 host (format "%s" service) 294 host (format "%s" service)
288 starttls-extra-args))) 295 starttls-extra-args)))
289 (process-kill-without-query process) 296 (starttls-set-process-query-on-exit-flag process nil)
290 process))) 297 process)))
291 298
292(provide 'starttls) 299(provide 'starttls)