From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: marmot-te Newsgroups: gmane.emacs.bugs Subject: bug#43573: 26.1; set-process-buffer doesn't create a process marker Date: Tue, 22 Sep 2020 19:44:17 +0000 Message-ID: <871ritr41x.fsf@host.localdomain> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30983"; mail-complaints-to="usenet@ciao.gmane.io" To: 43573@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 22 23:59:47 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKqKA-0007yx-SV for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Sep 2020 23:59:47 +0200 Original-Received: from localhost ([::1]:39744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKqK9-0002xs-S3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Sep 2020 17:59:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKq8o-0005IS-SJ for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 17:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKq8o-0001cW-H7 for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 17:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKq8o-0002oz-El for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 17:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: marmot-te Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Sep 2020 21:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43573 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160081122510775 (code B ref -1); Tue, 22 Sep 2020 21:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Sep 2020 21:47:05 +0000 Original-Received: from localhost ([127.0.0.1]:33615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKq7t-0002ni-0w for submit@debbugs.gnu.org; Tue, 22 Sep 2020 17:47:05 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:51872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKoDT-0008GO-4E for submit@debbugs.gnu.org; Tue, 22 Sep 2020 15:44:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKoDS-0005Ba-PN for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 15:44:42 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:40906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKoDQ-0003MY-7i for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 15:44:42 -0400 Original-Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4BwsFx3gRNzDt1J for ; Tue, 22 Sep 2020 12:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1600803877; bh=s5BAZ1RUX3eu/c92woxGWXYwDhwd2VY7rg8tP1y01gc=; h=From:To:Subject:Date:From; b=pW7ctdOboiKz3Uv9JN808a6oiwNfoT8nRkV7JDaex1v75r8vlqbcnNc7URTZnR3T5 QCunvH+wgyn0pm7bO+ERk1bm95KMYt9pMaLOU83RDqAo+CTrOpGal0dCA9xnBfhygA zzotddMANrqXRHkyyshTTo1QwBIFcYIrdlzxcdv0= X-Riseup-User-ID: CF01B47E0B89C3D1676B93DDCFF8C0EDA8359DAB9E47364B5CE951030C90B039 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by capuchin.riseup.net (Postfix) with ESMTPSA id 4BwsFw0Z9Bz8swp for ; Tue, 22 Sep 2020 12:44:35 -0700 (PDT) Received-SPF: pass client-ip=198.252.153.129; envelope-from=marmot-te@riseup.net; helo=mx1.riseup.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 15:44:37 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, MPART_ALT_DIFF=0.79, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 22 Sep 2020 17:47:04 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188752 Archived-At: --=-=-= Content-Type: text/plain --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 =E2=80=9CLand of Lisp=E2=80=9D 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 sentin= el trigger, so ;; it seems useless to use sentinel for processing the GET r= equest. ;; 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. -- --==-=-= Content-Type: multipart/related; boundary="===-=-=" --===-=-= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Hello GNU’s wizards,

I noticed that creating a buffer for a process with set-process-buffe= r
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 =E2=80=9CLand of Lisp=E2=80=9D 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 sentin= el trigger, so
;; it seems useless to use sentinel for processing the GET r= equest.
;; 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-handle= r 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,


--===-=-=-- --==-=-=-- --=-=-= Content-Type: multipart/related; boundary="====-=-=" --====-=-= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

<#multipart type=3Dalternative><#part type=3Dtext/plain>

Hello GNU’s wizards,

I noticed that creating a buffer for a process with set-process-buffe= r
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 =E2=80=9CLand of Lisp=E2=80=9D 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 sentin= el trigger, so
;; it seems useless to use sentinel for processing the GET r= equest.
;; 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-handle= r 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=3Drelated><#part type=3Dtext/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 /&= gt;
retrieved with <code>process-mark</code> afteward.<br /><= 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 functio= n 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<b= r />
translated from Common Lisp, in the book =E2=80=9CLand of Lisp=E2=80=9D 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.&= lt;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 sentin= el trigger, so<br />
;; it seems useless to use sentinel for processing the GET r= equest.<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-ha= ndler 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; cl= ient)<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>

--====-=-=-- --=-=-=--