From 0e3953c90cb3cee022ab56634619a717dd717ee1 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 27 Oct 2014 11:35:25 +0100 Subject: derive mode from tabulated-list-mode --- grid-engine-mode.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/grid-engine-mode.el b/grid-engine-mode.el index 60220dc..a023f30 100644 --- a/grid-engine-mode.el +++ b/grid-engine-mode.el @@ -1,7 +1,18 @@ ;;; -*- lexical-binding: t -*- +(require 'derived) + +(define-derived-mode grid-engine + tabulated-list-mode "Grid Engine" + "Major mode for interacting with Grid Engine. + \\{grid-engine-mode-map}" + (interactive) + (kill-all-local-variables) + (setq major-mode 'grid-engine) + (setq mode-name "Grid Engine") + (grid-engine-setup) + (use-local-map grid-engine-map) + (run-hooks 'grid-engine-hook)) -(defcustom grid-engine-map nil - "Keymap for Grid Engine mode.") (defcustom grid-engine-host nil "The host on which Grid Engine is running. Defaults to localhost.") (defcustom grid-engine-qstat "/opt/sge/bin/lx-amd64/qstat" @@ -146,14 +157,4 @@ (grid-engine--cmd-to-buffer cmd title) (grid-engine--split-buffer))) - -(defun grid-engine () - "Major mode for interacting with Grid Engine." - (interactive) - (kill-all-local-variables) - (setq major-mode 'grid-engine) - (setq mode-name "Grid Engine") - (grid-engine-setup) - (use-local-map grid-engine-map) - (run-hooks 'grid-engine-hook)) (provide 'grid-engine-mode) -- cgit v1.2.3