bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43573: 26.1; set-process-buffer doesn't create a process marker


From: marmot-te
Subject: bug#43573: 26.1; set-process-buffer doesn't create a process marker
Date: Tue, 22 Sep 2020 19:44:17 +0000

<#multipart type=alternative><#part type=text/plain>

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,
Pillule.

<#multipart type=related><#part type=text/html><p>
Hello GNU&rsquo;s wizards,<br />
</p>

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

<p>
While the documentation doesn&rsquo;t imply it, and it not something<br />
obiously necessary, I still consider it as a bug for<br />
<code>set-process-buffer</code> because I see nowhere a function which can create<br />
such process marker.<br />
</p>

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

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

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

<p>
Freely,<br />
<br />
&#x2013;<br />
</p>
<#/multipart>
<#/multipart>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]