Subject: bug#72652: sentinel

From: Greg Minshall <[email-masked]>
Date: Fri, 16 Aug 2024 09:11:00 +0300

i guess one can get some notification from a sentinel, though finding
the process itself is a bit kludgy:
````
(defun msg-me (process event)
  (princ
   (format "Process: %s had the event '%s'" process event)))

(let ((uproc (url-retrieve "https://y.example.com/index.html"
                           (lambda (x) (message "callback called: %s" x)))))
  (with-current-buffer uproc
    (set-process-sentinel url-http-process 'msg-me)))
````

gives output
````
Contacting host: y.example.com:443
Process: example.com had the event 'connection broken by remote peer
'
````

the message ("broken by remote peer") isn't as helpful as a "host does
not exist" message might be.

i guess to distinguish a name lookup failure, one could then (or before)
use, e.g., `dns-query-asynchronous`:

````
(dns-query-asynchronous
    "x.example.com"
    (lambda (x) (message "dns callback: %s" x)))
````

gives
````
dns callback: nil
````

(hope this formatting comes through reasonably...)