+(defun stgit-select-file ()
+ (let ((patched-file (stgit-patched-file-at-point)))
+ (unless patched-file
+ (error "No patch or file on the current line"))
+ (let ((filename (expand-file-name (cdr patched-file))))
+ (unless (file-exists-p filename)
+ (error "File does not exist"))
+ (find-file filename))))
+
+(defun stgit-toggle-patch-file-list (curpath)
+ (let ((inhibit-read-only t))
+ (if (memq curpatch stgit-expanded-patches)
+ (save-excursion
+ (setq stgit-expanded-patches (delq curpatch stgit-expanded-patches))
+ (stgit-collapse-patch curpatch))
+ (progn
+ (setq stgit-expanded-patches (cons curpatch stgit-expanded-patches))
+ (stgit-expand-patch curpatch)))))
+