From: Francesco Potorti` <pot@gnu.org>
To: bug-gnu-emacs@gnu.org, 443439-maintonly@bugs.debian.org,
Octave bugs list <bug-octave@bevo.che.wisc.edu>
Cc: Francesco Potorti` <Potorti@isti.cnr.it>,
Gabriele Oligeri <gabriele.oligeri@isti.cnr.it>
Subject: Re: Bug#443439: emacs: run-octave captures the shell directory tracker
Date: Fri, 21 Sep 2007 12:29:05 +0200 [thread overview]
Message-ID: <E1IYfkv-0008G3-Fj@tucano.isti.cnr.it> (raw)
In-Reply-To: <E1IYf44-000867-OA@tucano.isti.cnr.it>
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ì <pot@gnu.org>
* 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: Potorti@isti.cnr.it
Web: http://fly.isti.cnr.it/ Key: fly.isti.cnr.it/public.key
next prev parent reply other threads:[~2007-09-21 10:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-21 9:44 emacs: run-octave captures the shell directory tracker Francesco Potorti`
2007-09-21 10:29 ` Francesco Potorti` [this message]
2007-09-21 11:32 ` Bug#443439: " Andreas Schwab
2007-09-21 11:47 ` Francesco Potorti`
2007-09-21 15:44 ` John W. Eaton
[not found] ` <E1IYl9C-00019F-27@tucano.isti.cnr.it>
[not found] ` <je1wcs2aoy.fsf@sykes.suse.de>
2007-09-21 18:10 ` Francesco Potorti`
2007-09-21 19:29 ` Andreas Schwab
2007-09-22 11:57 ` Richard Stallman
2007-10-05 17:56 ` John W. Eaton
2007-10-06 1:52 ` Glenn Morris
2007-09-22 18:41 ` Glenn Morris
2007-09-22 20:13 ` Francesco Potorti`
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=E1IYfkv-0008G3-Fj@tucano.isti.cnr.it \
--to=pot@gnu.org \
--cc=443439-maintonly@bugs.debian.org \
--cc=Potorti@isti.cnr.it \
--cc=bug-gnu-emacs@gnu.org \
--cc=bug-octave@bevo.che.wisc.edu \
--cc=gabriele.oligeri@isti.cnr.it \
/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.