changeset 24930:ea5923fcc5b2

inferior-octave-directory-tracker: Change regexp so that it doesn't think functions beginning with `cd' are directory-changing commands.
author Stephen Eglen <stephen@gnu.org>
date Wed, 07 Jul 1999 20:49:12 +0000
parents 6ba667635e10
children 6ccce3af0d2a
files lisp/progmodes/octave-inf.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/octave-inf.el	Wed Jul 07 16:45:31 1999 +0000
+++ b/lisp/progmodes/octave-inf.el	Wed Jul 07 20:49:12 1999 +0000
@@ -351,9 +351,11 @@
 (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.