unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: marmot-te <marmot-te@riseup.net>
To: 43573@debbugs.gnu.org
Subject: bug#43573: 26.1; set-process-buffer doesn't create a process marker
Date: Tue, 22 Sep 2020 19:44:17 +0000	[thread overview]
Message-ID: <871ritr41x.fsf@host.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.1: Type: text/plain, Size: 2445 bytes --]


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



[-- Attachment #2.2.1: Type: text/html, Size: 2918 bytes --]

[-- Attachment #3.1: Type: text/html, Size: 6963 bytes --]

             reply	other threads:[~2020-09-22 19:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 19:44 marmot-te [this message]
2020-09-24 15:17 ` bug#43573: 26.1; set-process-buffer doesn't create a process marker Lars Ingebrigtsen
2020-10-03 14:13   ` marmot-te

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ritr41x.fsf@host.localdomain \
    --to=marmot-te@riseup.net \
    --cc=43573@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).