unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Narendra Joshi <narendraj9@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Query about Emacs Process API | Asynchronous processes
Date: Wed, 08 Jul 2020 00:26:38 +0200	[thread overview]
Message-ID: <87imezyna9.fsf@gmail.com> (raw)
In-Reply-To: <87eeppydvc.fsf@gmail.com> (Narendra Joshi's message of "Sun, 05 Jul 2020 21:13:11 +0200")

Narendra Joshi <narendraj9@gmail.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> I read that section of the manual. I am still not sure what will be the
>>> use cases for this. Where in Emacs (or the package ecosystem) is this
>>> feature being used currently?
>>
>> I think it's used for `ielm`.
>>
>>         Stefan
>>
> `ielm` seems to be adding a dummy process to its buffer using either
> `cat` or `hexl` binary.
>
>   ;; A dummy process to keep comint happy. It will never get any input
>   (unless (comint-check-proc (current-buffer))
>     ;; Was cat, but on non-Unix platforms that might not exist, so
>     ;; use hexl instead, which is part of the Emacs distribution.
>     (condition-case nil
>         (start-process "ielm" (current-buffer) "hexl")
>       (file-error (start-process "ielm" (current-buffer) "cat")))
>     (set-process-query-on-exit-flag (ielm-process) nil)
>     (goto-char (point-max))

I, finally, found the reason for adding it. It's being used by
`gdb-mi.el`. I am still not sure how and why because I am not familiar
with `gdb-mi`.

#+begin_src emacs-lisp
;; We want to use comint because it has various nifty and familiar features.
(define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
  "Major mode for gdb inferior-io."
  :syntax-table nil :abbrev-table nil
  (make-comint-in-buffer "gdb-inferior" (current-buffer) nil))
#+end_src

The feature was added to `make-process` for `gdb-mi.el` in this commit: 

#+begin_src vc-git-log-view
850d0752fb8ab02e3ffc80567578f9e9a4cb77f9
Author: Nick Roberts <nickrob@snap.net.nz>
Date:   Thu Aug 13 13:22:55 2009 +0000

    (create_pty): New function.
    (Fstart_process): Use it to allow Emacs to just associate a pty
    with the buffer.  See associated change in gdb-mi.el.
    (list_processes_1): Deal with no program name.
    (start_process_unwind): Use pid == -2 to mean no process.
850d0752fb8ab02e3ffc80567578f9e9a4cb77f9
#+end_src

Best,
-- 
Narendra Joshi



      reply	other threads:[~2020-07-07 22:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-04 22:42 Query about Emacs Process API | Asynchronous processes Narendra Joshi
2020-07-05 14:29 ` Eli Zaretskii
2020-07-05 14:33   ` Narendra Joshi
2020-07-05 15:25     ` Stefan Monnier
2020-07-05 19:13       ` Narendra Joshi
2020-07-07 22:26         ` Narendra Joshi [this message]

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=87imezyna9.fsf@gmail.com \
    --to=narendraj9@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.
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).