From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: detect prompt change for interactive python Date: Thu, 17 Jul 2008 08:03:49 +0200 Message-ID: <87r69tm4hm.fsf@tux.homenetwork> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1216274795 32412 80.91.229.12 (17 Jul 2008 06:06:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Jul 2008 06:06:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: gamename Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 17 08:07:23 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KJMeB-0002Lr-1A for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Jul 2008 08:07:23 +0200 Original-Received: from localhost ([127.0.0.1]:59486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJMdI-0002zA-90 for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Jul 2008 02:06:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJMcu-0002z5-4i for help-gnu-emacs@gnu.org; Thu, 17 Jul 2008 02:06:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJMcs-0002yt-5v for help-gnu-emacs@gnu.org; Thu, 17 Jul 2008 02:06:03 -0400 Original-Received: from [199.232.76.173] (port=34643 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJMcs-0002yq-1R for help-gnu-emacs@gnu.org; Thu, 17 Jul 2008 02:06:02 -0400 Original-Received: from ug-out-1314.google.com ([66.249.92.171]:6878) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJMcr-0001jq-Kq for help-gnu-emacs@gnu.org; Thu, 17 Jul 2008 02:06:01 -0400 Original-Received: by ug-out-1314.google.com with SMTP id l31so687742ugc.48 for ; Wed, 16 Jul 2008 23:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=IVib+JDcmUp+EUuPyjmNzCOnNN/Zax0KlatJSzBMjX0=; b=PBZWYKE6wmbk7iuCdA2sscBBYTzzV+RZKlC5U5Zf90fPi25cMshH0BzK/enk7hj77W RL2qVXuXvTmKj+G636eHjVeNhJqwOt0/P+CkTzBCRRFMJmrON5u7l68QjvrSSl0Ro2Ll /qLOaCh3GyCPy7tmi+7ZYj19r2FT8eIzCVuXc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=HdiGRQMokpAq9KpdIdL8FyUTx4f1qhhflzk20/q42qKq9DIL2B+79lZQeWqjVGj37n WiGarLSuLJG8F0F3aNhd9ARXKjZdz6g2JAa+NEWoTRn+CGr7qsmqtX6NDckHtLJwJWdK Dbfa864KvUTWbAYgymVg0InVyxb+0oF8P5Ae0= Original-Received: by 10.66.249.20 with SMTP id w20mr3682590ugh.22.1216274757877; Wed, 16 Jul 2008 23:05:57 -0700 (PDT) Original-Received: from tux.homenetwork ( [77.197.77.21]) by mx.google.com with ESMTPS id 36sm3321939ugb.77.2008.07.16.23.05.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 16 Jul 2008 23:05:56 -0700 (PDT) In-Reply-To: (gamename's message of "Wed, 16 Jul 2008 11:53:26 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:55670 Archived-At: gamename writes: > Hi, > > My normal prompt is "> ". When I start python interactively with > "python -i", the prompt is now set to ">>> ". > > Everything works fine except when I try to recall the previous > commands with "comint-previous-input". The previous command is > restored to a position just after the first ">" sign. > > Here are some examples. > > bash prompt: >> oldCmdRecalled > > python interactive: >>oldCmdRecalled>> > > behavior I want: >>>> oldCmdRecalled > > How do I dynamically set the buffer to accept ">>>" as a prompt and > restore commands in the correct spot? Instead of calling python -i in a shell, use `py-shell' if you use python-mode or if you use python.el (the emacs default) `python-shell'. NOTE:python-mode is much better, you can use it with ipython. -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France