diff options
Diffstat (limited to 'grid-engine-mode.el')
-rw-r--r-- | grid-engine-mode.el | 20 |
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))) |