From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francesco Potorti` Newsgroups: gmane.emacs.bugs Subject: Re: Bug#443439: emacs: run-octave captures the shell directory tracker Date: Fri, 21 Sep 2007 12:29:05 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: sea.gmane.org 1190370709 13892 80.91.229.12 (21 Sep 2007 10:31:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Sep 2007 10:31:49 +0000 (UTC) Cc: Francesco Potorti` , Gabriele Oligeri To: bug-gnu-emacs@gnu.org, 443439-maintonly@bugs.debian.org, Octave bugs list Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 21 12:31:48 2007 Return-path: Envelope-to: geb-bug-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 1IYfnX-0002vv-Ca for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2007 12:31:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYfnV-0004zW-8Q for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2007 06:31:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IYfnT-0004yk-Be for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2007 06:31:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IYfnS-0004xH-09 for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2007 06:31:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYfnR-0004xC-MD for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2007 06:31:41 -0400 Original-Received: from mx1.isti.cnr.it ([194.119.192.3]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IYfnR-0000GE-7x for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2007 06:31:41 -0400 Original-Received: from conversionlocal.isti.cnr.it by mx.isti.cnr.it (PMDF V6.3 #31251) id <01MLMCX3NE8W9OE1WH@mx.isti.cnr.it> for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2007 12:31:04 +0200 Original-Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by mx.isti.cnr.it (PMDF V6.3 #31251) with ESMTPSA id <01MLMCUR0WQ09ODYSJ@mx.isti.cnr.it>; Fri, 21 Sep 2007 12:29:08 +0200 Original-Received: from pot by tucano.isti.cnr.it with local (Exim 4.67) (envelope-from ) id 1IYfkv-0008G3-Fj; Fri, 21 Sep 2007 12:29:05 +0200 In-reply-to: X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 X-Detected-Kernel: OpenVMS 7.2 (Multinet 4.3-4.4 stack) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16584 Archived-At: Shell mode is unusable together with octave inferior mode, because it often loses the notion of current directory. Appended is a patch. Apparently there are two problems. The facts: shell mode adds a directory tracker to comint input filter= s, but only locally: | comint-input-filter-functions is a variable defined in `comint.el'= . | Its value is | (shell-directory-tracker t) | | Permanently local in buffer *shell*; global value is nil However, octave-inf mode changes it also globally, and in fact, after running M-x run-octave RET, one gets this in the shell buffer: | comint-input-filter-functions is a variable defined in `comint.el'= . | Its value is | (shell-directory-tracker t) | | Permanently local in buffer *shell*; global value is | (inferior-octave-directory-tracker) My interpretation: The first problem is that inferior-octave-mode sets comint-input-filter-functions globally rather than locally only. The second problem is that shell-mode uses the global value of comint-input-filter-functions rather than the local one. This patch solves (or hides?) the first problem and removes the symptoms. The second problem, if I diagnosed it correctly, is more serious and I will not touch upon it. 2007-09-21 Francesco Potort=EC =09* progmodes/octave-inf.el (inferior-octave-mode): make local the =09comint-input-filter-functions variable before setting it. --- /usr/share/emacs/22.1/lisp/progmodes/octave-inf.el~=092007-01-21 = 04:20:44.000000000 +0100 +++ /usr/share/emacs/22.1/lisp/progmodes/octave-inf.el=092007-09-21 1= 2:11:09.000000000 +0200 @@ -153,8 +153,9 @@ Entry to this mode successively runs the =20 (setq comint-input-ring-file-name =09(or (getenv "OCTAVE_HISTFILE") "~/.octave_hist") -=09comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024) -=09comint-input-filter-functions '(inferior-octave-directory-tracker= )) +=09comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024)) + (set (make-local-variable 'comint-input-filter-functions) + '(inferior-octave-directory-tracker)) (set (make-local-variable 'comint-dynamic-complete-functions) inferior-octave-dynamic-complete-functions) (comint-read-input-ring t) If this patch is good, I can install it in the Emacs CVS. --=20 Francesco Potort=EC (ricercatore) Voice: +39 050 315 3058 (op.= 2111) ISTI - Area della ricerca CNR Fax: +39 050 315 2040 via G. Moruzzi 1, I-56124 Pisa Email: Potorti@isti.cnr.it Web: http://fly.isti.cnr.it/ Key: fly.isti.cnr.it/public.= key