diff options
| author | Ryan Barrett | 2011-10-17 21:48:28 +0200 |
|---|---|---|
| committer | Michael Albinus | 2011-10-17 21:48:28 +0200 |
| commit | 87e478b3c1180f9e73396c2fa7c4db55da155489 (patch) | |
| tree | 1cb20fd84963c9beed852bb0bbc7dd6c1fd9bd8a | |
| parent | f2ff9e88941024ca1ca03f8ea1404536bc3c1475 (diff) | |
| download | emacs-87e478b3c1180f9e73396c2fa7c4db55da155489.tar.gz emacs-87e478b3c1180f9e73396c2fa7c4db55da155489.zip | |
* dirtrack.el (dirtrack): Support shell buffers with path
prefixes, e.g. tramp-based remote shells. (Bug#9647)
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/dirtrack.el | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8034cebf0e5..471b1219c19 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-10-17 Ryan Barrett <emacs@ryanb.org> (tiny change) | ||
| 2 | |||
| 3 | * dirtrack.el (dirtrack): Support shell buffers with path | ||
| 4 | prefixes, e.g. tramp-based remote shells. (Bug#9647) | ||
| 5 | |||
| 1 | 2011-10-17 Teodor Zlatanov <tzz@lifelogs.com> | 6 | 2011-10-17 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 7 | ||
| 3 | * json.el: Bump version to 1.3 and note change in History. | 8 | * json.el: Bump version to 1.3 and note change in History. |
diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el index c3dfc747772..23a05816a2d 100644 --- a/lisp/dirtrack.el +++ b/lisp/dirtrack.el | |||
| @@ -227,7 +227,7 @@ If directory tracking does not seem to be working, you can use the | |||
| 227 | function `dirtrack-debug-mode' to turn on debugging output." | 227 | function `dirtrack-debug-mode' to turn on debugging output." |
| 228 | (unless (or (null dirtrack-mode) | 228 | (unless (or (null dirtrack-mode) |
| 229 | (eq (point) (point-min))) ; no output? | 229 | (eq (point) (point-min))) ; no output? |
| 230 | (let (prompt-path | 230 | (let (prompt-path orig-prompt-path |
| 231 | (current-dir default-directory) | 231 | (current-dir default-directory) |
| 232 | (dirtrack-regexp (nth 0 dirtrack-list)) | 232 | (dirtrack-regexp (nth 0 dirtrack-list)) |
| 233 | (match-num (nth 1 dirtrack-list))) | 233 | (match-num (nth 1 dirtrack-list))) |
| @@ -243,8 +243,9 @@ function `dirtrack-debug-mode' to turn on debugging output." | |||
| 243 | (if (not (> (length prompt-path) 0)) | 243 | (if (not (> (length prompt-path) 0)) |
| 244 | (dirtrack-debug-message "Match is empty string") | 244 | (dirtrack-debug-message "Match is empty string") |
| 245 | ;; Transform prompts into canonical forms | 245 | ;; Transform prompts into canonical forms |
| 246 | (setq prompt-path (funcall dirtrack-directory-function | 246 | (setq orig-prompt-path (funcall dirtrack-directory-function |
| 247 | prompt-path) | 247 | prompt-path) |
| 248 | prompt-path (shell-prefixed-directory-name orig-prompt-path) | ||
| 248 | current-dir (funcall dirtrack-canonicalize-function | 249 | current-dir (funcall dirtrack-canonicalize-function |
| 249 | current-dir)) | 250 | current-dir)) |
| 250 | (dirtrack-debug-message | 251 | (dirtrack-debug-message |
| @@ -257,8 +258,9 @@ function `dirtrack-debug-mode' to turn on debugging output." | |||
| 257 | ;; It's possible that Emacs will think the directory | 258 | ;; It's possible that Emacs will think the directory |
| 258 | ;; won't exist (eg, rlogin buffers) | 259 | ;; won't exist (eg, rlogin buffers) |
| 259 | (if (file-accessible-directory-p prompt-path) | 260 | (if (file-accessible-directory-p prompt-path) |
| 260 | ;; Change directory | 261 | ;; Change directory. shell-process-cd adds the prefix, so we |
| 261 | (and (shell-process-cd prompt-path) | 262 | ;; need to give it the original (un-prefixed) path. |
| 263 | (and (shell-process-cd orig-prompt-path) | ||
| 262 | (run-hooks 'dirtrack-directory-change-hook) | 264 | (run-hooks 'dirtrack-directory-change-hook) |
| 263 | (dirtrack-debug-message | 265 | (dirtrack-debug-message |
| 264 | (format "Changing directory to %s" prompt-path))) | 266 | (format "Changing directory to %s" prompt-path))) |