]> git.eshelyaron.com Git - emacs.git/commitdiff
inferior-octave-directory-tracker: Change regexp so that it doesn't
authorStephen Eglen <stephen@gnu.org>
Wed, 7 Jul 1999 20:49:12 +0000 (20:49 +0000)
committerStephen Eglen <stephen@gnu.org>
Wed, 7 Jul 1999 20:49:12 +0000 (20:49 +0000)
think functions beginning with `cd' are directory-changing commands.

lisp/progmodes/octave-inf.el

index 097c8649f8bf8d16de192fd517dbd60891c79ab8..3c8f0e81e91ffb20f14d453bcc773f941a07aca8 100644 (file)
@@ -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.