0
@@ -159,13 +159,7 @@ must set it from minibuffer."
0
(defun ditz-call-process (command &optional arg popup-flag)
0
"Call ditz process asynchronously according with sub-commands."
0
(let* ((buffer (get-buffer-create (concat "*ditz-" command "*")))
0
- (proc (get-buffer-process buffer))
0
- ;; Reserve current directory to come back later It's needed when
0
- ;; automatically finding directory.
0
- (when buffer-file-name
0
- (setq current-directory (file-name-directory (buffer-file-name))))
0
+ (proc (get-buffer-process buffer)))
0
(if (and proc (eq (process-status proc) 'run))
0
(when (y-or-n-p (format "A %s process is running; kill it?"
0
@@ -182,9 +176,6 @@ must set it from minibuffer."
0
buffer shell-file-name nil shell-command-switch
0
(ditz-build-command command arg))
0
- (when current-directory
0
- (setq default-directory current-directory))
0
(cond ((or (eq major-mode 'ditz-mode)
0
(string= popup-flag "switch"))
0
(switch-to-buffer buffer))
0
@@ -204,30 +195,42 @@ must set it from minibuffer."
0
(goto-char (point-min)))))))))
0
(defvar ditz-last-visited-issue-directory nil)
0
(defun ditz-build-command (command arg)
0
- (let (issue-directory)
0
+ (let (issue-directory current-directory)
0
+ ;; Reserve current directory to come back later It's needed when
0
+ ;; automatically finding directory.
0
+ (when buffer-file-name
0
+ (setq current-directory (file-name-directory (buffer-file-name))))
0
(cond ((eq major-mode 'ditz-mode)
0
(setq issue-directory ditz-last-visited-issue-directory))
0
((and (not (string= command "init"))
0
- ditz-find-issue-directory-automatically-flag)
0
- (cond ((file-exists-p ditz-issue-directory)
0
- (concat default-directory ditz-issue-directory))
0
- ((string= "/" default-directory)
0
+ ditz-find-issue-directory-automatically-flag
0
+ (cond ((file-exists-p ditz-issue-directory)
0
+ ((string= "/" default-directory)
0
+ (concat default-directory ditz-issue-directory)))
0
(read-file-name "Issue dir: "
0
(or ditz-last-visited-issue-directory
0
+ ;; Restore default directory if needed.
0
+ (when current-directory
0
+ (setq default-directory current-directory))
0
(setq ditz-last-visited-issue-directory issue-directory)
0
- (mapconcat 'identity (list ditz-program command arg "-i" issue-directory) " ")))
0
+ (list ditz-program command arg "-i" issue-directory) " ")))
0
(defvar ditz-mode-hook nil
Comments
No one has commented yet.