From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.devel Subject: Re: Character mode for comint? Date: Sat, 29 Oct 2011 20:36:17 +0200 Message-ID: <871utvir1a.fsf@gmail.com> References: <87mxckp2vs.fsf@gmail.com> <87d3dgp2hb.fsf@gmail.com> <87r51wm3jw.fsf@gmail.com> <87k47om2e5.fsf@gmail.com> <87ty6rlvgn.fsf@gmail.com> <87fwiblsng.fsf@gmail.com> <87aa8jpxgq.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1319914825 18338 80.91.229.12 (29 Oct 2011 19:00:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Oct 2011 19:00:25 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 29 21:00:21 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RKE8j-0006XA-CY for ged-emacs-devel@m.gmane.org; Sat, 29 Oct 2011 21:00:21 +0200 Original-Received: from localhost ([::1]:46332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKE8d-00045O-2P for ged-emacs-devel@m.gmane.org; Sat, 29 Oct 2011 15:00:15 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKE8a-00045G-F0 for emacs-devel@gnu.org; Sat, 29 Oct 2011 15:00:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKE8Y-0006Ag-RH for emacs-devel@gnu.org; Sat, 29 Oct 2011 15:00:12 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:58442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKE8Y-0006Ac-Eo for emacs-devel@gnu.org; Sat, 29 Oct 2011 15:00:10 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RKE8X-0006U4-Mx for emacs-devel@gnu.org; Sat, 29 Oct 2011 21:00:09 +0200 Original-Received: from cab14-1-88-177-9-245.fbx.proxad.net ([88.177.9.245]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Oct 2011 21:00:09 +0200 Original-Received: from antoine.levitt by cab14-1-88-177-9-245.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Oct 2011 21:00:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cab14-1-88-177-9-245.fbx.proxad.net Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:145776 Archived-At: 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 > ;; Based on comint mode written by: Olin Shivers > > 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.