From 23b8841669cd990fb544745ad3081a2382c37596 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 24 Oct 2014 13:18:52 +0200 Subject: use underlying job alist to display job details --- grid-engine-mode.el | 20 ++++++++++++-------- 1 file 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 "") (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))) -- cgit v1.2.3