diff options
Diffstat (limited to 'lib/quilt.el')
-rw-r--r-- | lib/quilt.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/quilt.el b/lib/quilt.el index 9b1dabc..a907206 100644 --- a/lib/quilt.el +++ b/lib/quilt.el @@ -81,8 +81,9 @@ (if (not qd) (shell-command (concat "quilt " cmd) buf) (cd qd) - (shell-command (concat "quilt " cmd) buf) - (cd d)))) + (unwind-protect ; make sure to cd back even if an erro occurs. + (shell-command (concat "quilt " cmd) buf) + (cd d))))) (defun quilt-cmd-to-string (cmd) "execute a quilt command at the top of the quilt tree for the given buffer" @@ -91,8 +92,9 @@ (if (not qd) nil (cd qd) - (let ((r (shell-command-to-string (concat "quilt " cmd)))) - (cd d) r)))) + (unwind-protect ; make sure to cd back even if an error occurs. + (shell-command-to-string (concat "quilt " cmd)) + (cd d))))) (defun quilt-applied-list () (let ((s (quilt-cmd-to-string "applied"))) |