;;; starttls.el --- STARTTLS functions
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
;; Author: Daiki Ueno <ueno@unixuser.org>
;; Author: Simon Josefsson <simon@josefsson.org>
(starttls-set-process-query-on-exit-flag process nil)
(while (and (processp process)
(eq (process-status process) 'run)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(goto-char old-max)
(not (setq done (re-search-forward
starttls-connect nil t)))))
host port (if done "done" "failed"))
process))
+;;;###autoload
(defun starttls-open-stream (name buffer host port)
"Open a TLS connection for a port to a host.
Returns a subprocess object to represent the connection.
(starttls-set-process-query-on-exit-flag process nil)
process)))
-(defun starttls-any-program-available ()
- (let ((program (if starttls-use-gnutls
- starttls-gnutls-program
- starttls-program)))
- (condition-case ()
- (progn
- (call-process program)
- program)
- (error (progn
- (message "No STARTTLS program was available (tried '%s')"
- program)
- nil)))))
+(defun starttls-available-p ()
+ "Say whether the STARTTLS programs are available."
+ (executable-find (if starttls-use-gnutls
+ starttls-gnutls-program
+ starttls-program)))
+
+(defalias 'starttls-any-program-available 'starttls-available-p)
+(make-obsolete 'starttls-any-program-available 'starttls-available-p
+ "2011-08-02")
(provide 'starttls)
-;; arch-tag: 648b3bd8-63bd-47f5-904c-7c819aea2297
;;; starttls.el ends here