;(require 'rct-util)
;
(defconst rct-mode-buffer-name "*rct-main*"
"*internal* Name of the rct main view buffer.")
; let the user have the possibility to run his hown code
(defcustom rct-mode-hook nil
"Normal hook run when entering Text mode and many related modes."
:type 'hook
:group 'data)
; Keymap
(defvar rct-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c m")
(lambda() (interactive) (message "C-c m pressed")))
(define-key map (kbd "<f4>")
(lambda() (interactive) (message "<f4> pressed")))
(define-key map (kbd "<f5>")
(lambda() (interactive) (message "<f5> pressed")))
map )
"Keymap for `rct-mode'.")
;; h1 first header in blue
(defface h1
'((t :inherit default
(:background "blue")
))
"Face for a header without any special flags."
:group 'rct-faces)
(define-derived-mode rct-mode special-mode "rct:main"
"Major mode for remote connections
\\{rct-main-mode-map}."
(setq debug-on-error t)
(use-local-map rct-mode-map)
(run-hooks 'rct-mode-hook)
(main-menu))
; Main Menu
(defun main-menu ()
"This function display the main menu of the RCT mode."
(with-current-buffer (get-buffer-create rct-mode-buffer-name)
(erase-buffer)
(insert
"\n\n\n\n"
(propertize "~~ Welcome ~~" 'face 'h1)
"\n\n"
"Main commands"
"\n\n"
"\t[Q] To quit the RCT-mode"
"\n\n"
"Section 1"
"\n\n"
"\t[F2] To Start XXXX\n"
"\t[F3] To Start YYYYY\n"
"\n"
"Section 2"
"\n\n"
"\t[F4] To Start ZZZZZ\n"
"\n\n"
); end-of insert
);end-of with-current-buffer
;);end-of let
(switch-to-buffer rct-mode-buffer-name)
(toggle-read-only t)
);end-of main-menu
;
(provide 'rct-mode)
Many thanks.