summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2014-10-24 13:18:52 +0200
committerRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2014-10-24 13:18:52 +0200
commit23b8841669cd990fb544745ad3081a2382c37596 (patch)
tree480fd1e821efa007e0c6bc231a4a0cf67df1cb59
parent86e39f1ee3aa7222c81c0bf6d37195e56d091221 (diff)
use underlying job alist to display job details
-rw-r--r--grid-engine-mode.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/grid-engine-mode.el b/grid-engine-mode.el
index b91c829..988d4c5 100644
--- a/grid-engine-mode.el
+++ b/grid-engine-mode.el
@@ -21,7 +21,11 @@
(define-key grid-engine-map (kbd "<RET>")
(lambda (&optional arg)
(interactive)
- (grid-engine-job-details (thing-at-point 'word) arg)))
+ (let ((field (get-text-property (point) 'field))
+ (job (get-text-property (point) 'grid-engine-job)))
+ (unless (and field job)
+ (error "[Grid Engine] point is not on a field of a job record"))
+ (grid-engine-job-details field job arg))))
(define-key grid-engine-map (kbd "g")
(lambda () (interactive) (grid-engine-list-jobs)))))
@@ -119,13 +123,13 @@
(grid-engine--raise-buffer)
(message nil)))
-(defun grid-engine-job-details (job-id &optional new-buffer)
-; (unless (number-or-marker-p job-id)
-; (error "[Grid Engine] %s is not a valid job id."))
- (let ((cmd (concat grid-engine-qstat " -j " job-id))
- (title (if new-buffer
- (concat "*grid-engine-job-details-" job-id "*")
- "*grid-engine-job-details*")))
+(defun grid-engine-job-details (field job &optional new-buffer)
+ (message (format "%s" job))
+ (let* ((job-id (cdr (assoc 'job-id job)))
+ (cmd (concat grid-engine-qstat " -j " job-id))
+ (title (if new-buffer
+ (concat "*grid-engine-job-details-" job-id "*")
+ "*grid-engine-job-details*")))
(message "[Grid Engine] fetching details for job %s" job-id)
(grid-engine--cmd-to-buffer cmd title)
(grid-engine--split-buffer)))