bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#443439: emacs: run-octave captures the shell directory tracker


From: Francesco Potorti`
Subject: Re: Bug#443439: emacs: run-octave captures the shell directory tracker
Date: Fri, 21 Sep 2007 12:29:05 +0200

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 filters,
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ì  <address@hidden>

        * progmodes/octave-inf.el (inferior-octave-mode): make local the
        comint-input-filter-functions variable before setting it.


--- /usr/share/emacs/22.1/lisp/progmodes/octave-inf.el~ 2007-01-21 
04:20:44.000000000 +0100
+++ /usr/share/emacs/22.1/lisp/progmodes/octave-inf.el  2007-09-21 
12:11:09.000000000 +0200
@@ -153,8 +153,9 @@ Entry to this mode successively runs the
 
   (setq comint-input-ring-file-name
        (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist")
-       comint-input-ring-size (or (getenv "OCTAVE_HISTSIZE") 1024)
-       comint-input-filter-functions '(inferior-octave-directory-tracker))
+       comint-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.

-- 
Francesco Potortì (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: address@hidden
Web: http://fly.isti.cnr.it/           Key:   fly.isti.cnr.it/public.key





reply via email to

[Prev in Thread] Current Thread [Next in Thread]