- (condition-case nil
- (progn
- (make-network-process :name "elpher-process"
- :host (elpher-address-host address)
- :service (elpher-address-port address)
- :filter (lambda (proc string)
- (setq elpher-selector-string
- (concat elpher-selector-string string)))
- :sentinel after)
- (process-send-string "elpher-process"
+ (when (elpher-address-use-tls-p address)
+ (if (gnutls-available-p)
+ (when (not elpher-use-tls)
+ (setq elpher-use-tls t)
+ (message "Engaging TLS mode."))
+ (error "Cannot retrieve TLS selector: GnuTLS not available")))
+ (condition-case the-error
+ (let* ((kill-buffer-query-functions nil)
+ (proc (open-network-stream "elpher-process"
+ nil
+ (elpher-address-host address)
+ (elpher-address-port address)
+ :type (if elpher-use-tls 'tls 'plain))))
+ (set-process-coding-system proc 'binary)
+ (set-process-filter proc
+ (lambda (proc string)
+ (setq elpher-selector-string
+ (concat elpher-selector-string string))))
+ (set-process-sentinel proc after)
+ (process-send-string proc