|
@@ -17,6 +17,11 @@
|
|
|
|
|
|
(require 'rpl-base)
|
|
|
|
|
|
+(defcustom rpl-sysrpl-default-calculator :HP48G
|
|
|
+ "Default calculator type for SysRPL mode."
|
|
|
+ :type '(radio :HP38G :HP39G :HP48G :HP49G)
|
|
|
+ :group 'rpl)
|
|
|
+
|
|
|
(defface sysrpl-name '((t (:foreground "blue")))
|
|
|
"Face used for displaying SysRPL names."
|
|
|
:group 'rpl)
|
|
@@ -52,9 +57,49 @@
|
|
|
(defvar sysrpl-font-lock-keywords
|
|
|
(list (cons sysrpl-keywords-regexp 'sysrpl-keyword-face)))
|
|
|
|
|
|
+(defvar sysrpl-selected-calculator rpl-sysrpl-default-calculator
|
|
|
+ "Currently selected calculator model.")
|
|
|
+
|
|
|
+(defun sysrpl-select-hp38g ()
|
|
|
+ "Set the currently selected calculator model to be the 38G."
|
|
|
+ (interactive)
|
|
|
+ (setq sysrpl-selected-calculator :HP38G))
|
|
|
+
|
|
|
+(defun sysrpl-select-hp39g ()
|
|
|
+ "Set the currently selected calculator model to be the 39G."
|
|
|
+ (interactive)
|
|
|
+ (setq sysrpl-selected-calculator :HP39G))
|
|
|
+
|
|
|
+(defun sysrpl-select-hp48g ()
|
|
|
+ "Set the currently selected calculator model to be the 48G."
|
|
|
+ (interactive)
|
|
|
+ (setq sysrpl-selected-calculator :HP48G))
|
|
|
+
|
|
|
+(defun sysrpl-select-hp49g ()
|
|
|
+ "Set the currently selected calculator model to be the 49G."
|
|
|
+ (interactive)
|
|
|
+ (setq sysrpl-selected-calculator :HP49G))
|
|
|
+
|
|
|
(defvar sysrpl-mode-map
|
|
|
- (let ((map (make-sparse-keymap)))
|
|
|
+ (let ((map (make-sparse-keymap))
|
|
|
+ (menu-map (make-sparse-keymap)))
|
|
|
(set-keymap-parent map rpl-common-keymap)
|
|
|
+ ;; Menu items
|
|
|
+ (define-key map [menu-bar rpl-menu] (cons "RPL" menu-map))
|
|
|
+ (define-key menu-map [sysrpl-menu-separator-1]
|
|
|
+ '(menu-item "--"))
|
|
|
+ (define-key menu-map [sysrpl-menu-select-hp49g]
|
|
|
+ '(menu-item "HP49G" sysrpl-select-hp49g
|
|
|
+ :button (:radio . (eql :HP49G sysrpl-selected-calculator))))
|
|
|
+ (define-key menu-map [sysrpl-menu-select-hp48g]
|
|
|
+ '(menu-item "HP48G" sysrpl-select-hp48g
|
|
|
+ :button (:radio . (eql :HP48G sysrpl-selected-calculator))))
|
|
|
+ (define-key menu-map [sysrpl-menu-select-hp39g]
|
|
|
+ '(menu-item "HP39G" sysrpl-select-hp39g
|
|
|
+ :button (:radio . (eql :HP39G sysrpl-selected-calculator))))
|
|
|
+ (define-key menu-map [sysrpl-menu-select-hp38g]
|
|
|
+ '(menu-item "HP38G" sysrpl-select-hp38g
|
|
|
+ :button (:radio . (eql :HP38G sysrpl-selected-calculator))))
|
|
|
map)
|
|
|
"The SysRPL mode local keymap.")
|
|
|
|