summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Eglen <stephen@gnu.org>1999-07-07 20:49:12 +0000
committerStephen Eglen <stephen@gnu.org>1999-07-07 20:49:12 +0000
commit51352a011864c7f7465eb892d75f6f4f0262dc75 (patch)
tree3accef376d72073c623ab3b770a1473a0d7f778b
parent0dbbbe29a6709374344d59e25fb809937e478b35 (diff)
downloademacs-51352a011864c7f7465eb892d75f6f4f0262dc75.tar.gz
inferior-octave-directory-tracker: Change regexp so that it doesn't
think functions beginning with `cd' are directory-changing commands.
-rw-r--r--lisp/progmodes/octave-inf.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el
index 097c8649f8b..3c8f0e81e91 100644
--- a/lisp/progmodes/octave-inf.el
+++ b/lisp/progmodes/octave-inf.el
@@ -351,9 +351,11 @@ output is passed to the filter `inferior-octave-output-digest'."
(defun inferior-octave-directory-tracker (string)
"Tracks `cd' commands issued to the inferior Octave process.
Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused."
- (if (string-match "^[ \t]*cd[ \t]*\\([^ \t\n;]*\\)[ \t\n;]"
- string)
- (cd (substring string (match-beginning 1) (match-end 1)))))
+ (cond
+ ((string-match "^[ \t]*cd[ \t;]*$" string)
+ (cd "~"))
+ ((string-match "^[ \t]*cd[ \t]+\\([^ \t\n;]*\\)[ \t\n;]*" string)
+ (cd (substring string (match-beginning 1) (match-end 1))))))
(defun inferior-octave-resync-dirs ()
"Resync the buffer's idea of the current directory.