Hello GNU’s wizards,

I noticed that creating a buffer for a process with set-process-buffer
does not create also a marker specific to that process that can be
retrieved with process-mark afteward.

While the documentation doesn’t imply it, and it not something
obiously necessary, I still consider it as a bug for
set-process-buffer because I see nowhere a function which can create
such process marker.

Follow the code that trigger this discovery for some context explaining why
one may expect this marker to be created, it is a poor man html server
translated from Common Lisp, in the book “Land of Lisp” by Conrad Barsky.

(make-network-process
:name “web-server-process”
:buffer “web-server-buffer”
:server t
:service 8080
:host “127.0.0.1”
:family ’ipv4
:filter (lambda (proc string)
;; custom filter doesn’t create a dedicated buffer.
;; process marker is not created whith the process buffer ?
(let ((stream (set-buffer
(set-process-buffer proc
(get-buffer-create (process-name proc))))))
;; carriage returns everywhere …
(insert (remove ?\C-m string))
(beginning-of-buffer)
;; Unfortunally this filter is applyed only after the sentinel trigger, so
;; it seems useless to use sentinel for processing the GET request.
;; or should use accept-output-process?
(let* ((url (parse-url (read-line stream)))
(path (car url))
(header (get-header stream))
(params (append (cdr url)
(get-content-params stream header))))
(process-send-string proc
(funcall #’hello-request-handler path header params))
(process-send-eof proc)))
(set-process-query-on-exit-flag proc nil)
(kill-buffer (process-buffer proc)))
:log (lambda (server client message)
(princ (format “Client connected : %s\n” client)
(process-buffer (get-process server)))))

I did not deliver the functions missing because they are not involved in
the obsevation of the behavior discuted, will do but if you ask.

Freely,