From: Stephen Eglen Date: Wed, 7 Jul 1999 20:49:12 +0000 (+0000) Subject: inferior-octave-directory-tracker: Change regexp so that it doesn't X-Git-Tag: emacs-20.4~19 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=df287ddb468cb9c56853bca6076f496b5dc827a9;p=emacs.git inferior-octave-directory-tracker: Change regexp so that it doesn't think functions beginning with `cd' are directory-changing commands. --- 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.