From f7277dadc2a0712356ae4da04e88464f95819baf Mon Sep 17 00:00:00 2001 From: grischka Date: Tue, 4 May 2010 21:49:25 +0200 Subject: [PATCH] cleanup --- eproject.el | 88 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/eproject.el b/eproject.el index 4b7cdd6..4f9f172 100644 --- a/eproject.el +++ b/eproject.el @@ -644,8 +644,8 @@ do not belong to project files" (defun prj-find-file (a) (when a - (let ((n (car a)) f b pos) - (setq f (expand-file-name n prj-directory)) + (let (f b pos) + (setq f (expand-file-name (car a) prj-directory)) (setq b (get-file-buffer f)) (unless b (prj-removehooks) @@ -653,10 +653,11 @@ do not belong to project files" (prj-addhooks) (when b (with-current-buffer b - (rename-buffer n t) + (rename-buffer (car a) t) ) - (setq pos (cdr a)) - )) + (when (consp (cdr a)) + (setq pos (cdr a)) + ))) (when b (setcdr a b) (cons b pos) @@ -674,13 +675,12 @@ do not belong to project files" )) (defun prj-restore-edit-pos (pos w) - (when (consp pos) - (let ((top (car pos)) (line (cadr pos))) - (when (and (numberp top) (numberp line)) - (prj-goto-line top) - (set-window-start w (point)) - (prj-goto-line line) - )))) + (let ((top (car pos)) (line (cadr pos))) + (when (and (numberp top) (numberp line)) + (prj-goto-line top) + (set-window-start w (point)) + (prj-goto-line line) + ))) (defun prj-select-window (w) (let (focus-follows-mouse) @@ -927,35 +927,35 @@ do not belong to project files" ))) (defun prj-run (cmd) - (let (dir) - (when (string-match "^-in +\\([^[:space:]]+\\) +" cmd) - (setq dir (match-string-no-properties 1 cmd)) - (setq cmd (substring cmd (match-end 0))) - ) - (when prj-exec-directory - (setq dir (expand-file-name (or dir ".") prj-exec-directory)) - ) - (if dir (cd dir)) - (cond ((string-match "^-e +" cmd) - (setq cmd (read (substring cmd (match-end 0)))) - (unless (commandp cmd) - (setq cmd `(lambda () (interactive) ,cmd)) - ) - (command-execute cmd) - ) - ((string-match "\\(.+\\)& *$" cmd) - (start-process-shell-command "eproject-async" nil (match-string 1 cmd)) - (message (match-string 1 cmd)) + (cond ((string-match "^-e +" cmd) + (setq cmd (read (substring cmd (match-end 0)))) + (unless (commandp cmd) + (setq cmd `(lambda () (interactive) ,cmd)) ) - (t - (unless (or (fboundp 'ecb-activate) (fboundp 'ewm-init)) - (prj-setup-tool-window) + (command-execute cmd) + ) + ((let (dir) + (when (string-match "^-in +\\([^[:space:]]+\\) +" cmd) + (setq dir (match-string-no-properties 1 cmd)) + (setq cmd (substring cmd (match-end 0))) ) - (let ((display-buffer-reuse-frames t) (f (selected-frame))) - (compile cmd) - (select-frame-set-input-focus f) - ))))) - + (when prj-exec-directory + (setq dir (expand-file-name (or dir ".") prj-exec-directory)) + ) + (if dir (cd dir)) + (cond ((string-match "\\(.+\\)& *$" cmd) + (start-process-shell-command "eproject-async" nil (match-string 1 cmd)) + (message (match-string 1 cmd)) + ) + (t + (unless (or (fboundp 'ecb-activate) (fboundp 'ewm-init)) + (prj-setup-tool-window) + ) + (let ((display-buffer-reuse-frames t) (f (selected-frame))) + (compile cmd) + (select-frame-set-input-focus f) + ))))))) + (defun prj-run-tool (a) (unless (string-match "^--+$" (car a)) (prj-run (or (cadr a) (car a))) @@ -991,11 +991,11 @@ do not belong to project files" (if current-prefix-arg nil default) ))))) (let ((default-directory prj-directory)) - (dolist (f (mapcar 'car prj-files)) - (setq command-args (concat command-args " " f)) - ) - (grep command-args) - )) + (dolist (f (mapcar 'car prj-files)) + (setq command-args (concat command-args " " f)) + ) + (grep command-args) + )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; add files to the project with dired -- 2.11.4.GIT