all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Antoine Levitt <antoine.levitt@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Character mode for comint?
Date: Sat, 29 Oct 2011 20:36:17 +0200	[thread overview]
Message-ID: <871utvir1a.fsf@gmail.com> (raw)
In-Reply-To: 87aa8jpxgq.fsf@uwakimon.sk.tsukuba.ac.jp

29/10/11 18:35, Stephen J. Turnbull
> Antoine Levitt writes:
>
>  > Because then you don't benefit from the emacs interaction features of
>  > the various python modes, like sending the current
>  > buffer/region/defun. If your question is "why are these features
>  > implemented with comint rather than term-mode", I have no clue.
>
> Here's a clue:
>
> ;;; term.el --- general command interpreter in a window stuff
>
> ;; Copyright (C) 1988-1995, 1997 Free Software Foundation, Inc.
>
> ;; Author: Per Bothner <bothner@cygnus.com>
> ;; Based on comint mode written by: Olin Shivers <shivers@cs.cmu.edu>
>
> So comint can do it, and term-mode can teach you how to tickle comint
> mode into doing what you want it to do.  If you're very lucky, your
> investigation of term-mode may show that this is a feature of comint
> itself and you just have to enable it.

Actually, the basic code seems to be pretty simple. In character mode,
pretty much everything is mapped to term-send-raw, which is just a
wrapper around process-send-string. But what's more complex is the fact
that ipython (for instance) reacts to special strings (for instance,
tab, C-p, C-p ...) in a more complex way than just outputting something,
which comint doesn't seem to understand. In the end, that's probably the
difference between an input/output interface like comint and a real
terminal emulator like term. So the solution (for what I want to do
anyway) might be to run python inside term, and rewrite the shell
interaction code to send to term instead of comint.




  reply	other threads:[~2011-10-29 18:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-29  9:23 Character mode for comint? Antoine Levitt
2011-10-29  9:29 ` Andreas Schwab
2011-10-29  9:32   ` Antoine Levitt
2011-10-29 10:37     ` Andreas Schwab
2011-10-29 11:37       ` Antoine Levitt
2011-10-29 11:50         ` Andreas Schwab
2011-10-29 12:02           ` Antoine Levitt
2011-10-29 12:17             ` Andreas Schwab
2011-10-29 14:32               ` Antoine Levitt
2011-10-29 15:15                 ` Andreas Schwab
2011-10-29 15:33                   ` Antoine Levitt
2011-10-29 16:17                     ` Andreas Schwab
2011-10-29 18:36                       ` Antoine Levitt
2011-10-29 16:35                     ` Stephen J. Turnbull
2011-10-29 18:36                       ` Antoine Levitt [this message]
2011-10-29 19:48                         ` Stefan Monnier
2011-10-29 16:36 ` Stefan Monnier
2011-10-29 20:38   ` Antoine Levitt
2011-10-30  0:43     ` Stephen J. Turnbull
2011-10-30  1:13       ` Stephen J. Turnbull

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

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

  git send-email \
    --in-reply-to=871utvir1a.fsf@gmail.com \
    --to=antoine.levitt@gmail.com \
    --cc=emacs-devel@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.