|
@@ -23,9 +23,9 @@
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
;; Customizations
|
|
|
;;
|
|
|
-(defcustom rpl-sysrpl-default-calculator :48G
|
|
|
+(defcustom rpl-sysrpl-default-calculator :HP50G
|
|
|
"Default calculator type for SysRPL mode."
|
|
|
- :type '(radio :38G :39G :48G :49G)
|
|
|
+ :type '(radio :HP38G :HP39G :HP48G :HP49G :HP50G)
|
|
|
:group 'rpl)
|
|
|
|
|
|
(defface sysrpl-name '((t :foreground "darkblue"))
|
|
@@ -55,6 +55,14 @@
|
|
|
:type 'symbol
|
|
|
:group 'rpl)
|
|
|
|
|
|
+(defun sysrpl-edb-calculator (calculator)
|
|
|
+ "Map SysRPL calculator identifier to EDB identifier."
|
|
|
+ (cond ((eql calculator :HP38G) :38G)
|
|
|
+ ((eql calculator :HP39G) :39G)
|
|
|
+ ((eql calculator :HP48G) :48G)
|
|
|
+ ((eql calculator :HP49G) :49G)
|
|
|
+ ((eql calculator :HP50G) :49G)))
|
|
|
+
|
|
|
(defvar sysrpl-mode-syntax-table
|
|
|
(let ((table (make-syntax-table prog-mode-syntax-table)))
|
|
|
(modify-syntax-entry ?: "w" table)
|
|
@@ -89,60 +97,73 @@
|
|
|
names)))
|
|
|
|
|
|
(defvar sysrpl-font-lock-keywords
|
|
|
- (sysrpl-font-lock-compile-keywords (rpl-edb-all-names rpl-sysrpl-default-calculator)))
|
|
|
+ (sysrpl-font-lock-compile-keywords (rpl-edb-all-names (sysrpl-edb-calculator rpl-sysrpl-default-calculator))))
|
|
|
|
|
|
(defvar sysrpl-selected-calculator rpl-sysrpl-default-calculator
|
|
|
"Currently selected calculator model.")
|
|
|
|
|
|
-(defun sysrpl-select-38g ()
|
|
|
- "Set the currently selected calculator model to be the 38G."
|
|
|
+(defun sysrpl-select-hp38g ()
|
|
|
+ "Set the currently selected calculator model to be the HP38G."
|
|
|
+ (interactive)
|
|
|
+ (setq sysrpl-selected-calculator :HP38G)
|
|
|
+ (setq sysrpl-font-lock-keywords
|
|
|
+ (sysrpl-font-lock-compile-keywords (rpl-edb-all-names (sysrpl-edb-calculator :HP38G))))
|
|
|
+ (sysrpl-mode))
|
|
|
+
|
|
|
+(defun sysrpl-select-hp39g ()
|
|
|
+ "Set the currently selected calculator model to be the HP39G."
|
|
|
(interactive)
|
|
|
- (setq sysrpl-selected-calculator :38G)
|
|
|
- (setq sysrpl-font-lock-keywords (sysrpl-font-lock-compile-keywords (rpl-edb-all-names :38G)))
|
|
|
+ (setq sysrpl-selected-calculator :HP39G)
|
|
|
+ (setq sysrpl-font-lock-keywords
|
|
|
+ (sysrpl-font-lock-compile-keywords (rpl-edb-all-names (sysrpl-edb-calculator :HP39G))))
|
|
|
(sysrpl-mode))
|
|
|
|
|
|
-(defun sysrpl-select-39g ()
|
|
|
- "Set the currently selected calculator model to be the 39G."
|
|
|
+(defun sysrpl-select-hp48g ()
|
|
|
+ "Set the currently selected calculator model to be the HP48G."
|
|
|
(interactive)
|
|
|
- (setq sysrpl-selected-calculator :39G)
|
|
|
- (setq sysrpl-font-lock-keywords (sysrpl-font-lock-compile-keywords (rpl-edb-all-names :39G)))
|
|
|
+ (setq sysrpl-selected-calculator :HP48G)
|
|
|
+ (setq sysrpl-font-lock-keywords
|
|
|
+ (sysrpl-font-lock-compile-keywords (rpl-edb-all-names (sysrpl-edb-calculator :HP48G))))
|
|
|
(sysrpl-mode))
|
|
|
|
|
|
-(defun sysrpl-select-48g ()
|
|
|
- "Set the currently selected calculator model to be the 48G."
|
|
|
+(defun sysrpl-select-hp49g ()
|
|
|
+ "Set the currently selected calculator model to be the HP49G."
|
|
|
(interactive)
|
|
|
- (setq sysrpl-selected-calculator :48G)
|
|
|
- (setq sysrpl-font-lock-keywords (sysrpl-font-lock-compile-keywords (rpl-edb-all-names :48G)))
|
|
|
+ (setq sysrpl-selected-calculator :HP49G)
|
|
|
+ (setq sysrpl-font-lock-keywords
|
|
|
+ (sysrpl-font-lock-compile-keywords (rpl-edb-all-names (sysrpl-edb-calculator :HP49G))))
|
|
|
(sysrpl-mode))
|
|
|
|
|
|
-(defun sysrpl-select-49g ()
|
|
|
- "Set the currently selected calculator model to be the 49G."
|
|
|
+(defun sysrpl-select-hp50g ()
|
|
|
+ "Set the currently selected calculator model to be the HP50G."
|
|
|
(interactive)
|
|
|
- (setq sysrpl-selected-calculator :49G)
|
|
|
- (setq sysrpl-font-lock-keywords (sysrpl-font-lock-compile-keywords (rpl-edb-all-names :49G)))
|
|
|
+ (setq sysrpl-selected-calculator :HP50G)
|
|
|
+ (setq sysrpl-font-lock-keywords
|
|
|
+ (sysrpl-font-lock-compile-keywords (rpl-edb-all-names (sysrpl-edb-calculator :HP50G))))
|
|
|
(sysrpl-mode))
|
|
|
|
|
|
(defun sysrpl-get-eldoc-message ()
|
|
|
(interactive)
|
|
|
- (rpl-edb-get-stack-effect sysrpl-selected-calculator (thing-at-point 'word)))
|
|
|
+ (rpl-edb-get-stack-effect (sysrpl-edb-calculator sysrpl-selected-calculator)
|
|
|
+ (thing-at-point 'word)))
|
|
|
|
|
|
(defun sysrpl-apropos-thing-at-point (name)
|
|
|
"Show information about NAME in a popup buffer.
|
|
|
When called interactively NAME defaults to the word around
|
|
|
point."
|
|
|
- (interactive (list (completing-read "Apropos: " (rpl-edb-all-names sysrpl-selected-calculator)
|
|
|
+ (interactive (list (completing-read "Apropos: " (rpl-edb-all-names (sysrpl-edb-calculator sysrpl-selected-calculator))
|
|
|
nil nil (thing-at-point 'word))))
|
|
|
(let ((bufname (format "*SysRPL: %s*" name)))
|
|
|
(with-current-buffer (get-buffer-create bufname)
|
|
|
(setq buffer-read-only nil)
|
|
|
(erase-buffer)
|
|
|
- (insert (rpl-edb-get-stack-effect sysrpl-selected-calculator name))
|
|
|
+ (insert (rpl-edb-get-stack-effect (sysrpl-edb-calculator sysrpl-selected-calculator) name))
|
|
|
(newline)
|
|
|
- (insert (rpl-edb-get-description sysrpl-selected-calculator name))
|
|
|
+ (insert (rpl-edb-get-description (sysrpl-edb-calculator sysrpl-selected-calculator) name))
|
|
|
(newline)
|
|
|
- (insert (format "Address: %s" (rpl-edb-get-address sysrpl-selected-calculator name)))
|
|
|
+ (insert (format "Address: %s" (rpl-edb-get-address (sysrpl-edb-calculator sysrpl-selected-calculator) name)))
|
|
|
(newline)
|
|
|
- (insert (format "Flags: %s" (rpl-edb-get-flags sysrpl-selected-calculator name)))
|
|
|
+ (insert (format "Flags: %s" (rpl-edb-get-flags (sysrpl-edb-calculator sysrpl-selected-calculator) name)))
|
|
|
(newline)
|
|
|
(end-of-buffer)
|
|
|
(help-mode)
|
|
@@ -158,18 +179,21 @@ point."
|
|
|
(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-49g]
|
|
|
- '(menu-item "HP49G" sysrpl-select-49g
|
|
|
- :button (:radio . (eql :49G sysrpl-selected-calculator))))
|
|
|
- (define-key menu-map [sysrpl-menu-select-48g]
|
|
|
- '(menu-item "HP48G" sysrpl-select-48g
|
|
|
- :button (:radio . (eql :48G sysrpl-selected-calculator))))
|
|
|
- (define-key menu-map [sysrpl-menu-select-39g]
|
|
|
- '(menu-item "HP39G" sysrpl-select-39g
|
|
|
- :button (:radio . (eql :39G sysrpl-selected-calculator))))
|
|
|
- (define-key menu-map [sysrpl-menu-select-38g]
|
|
|
- '(menu-item "HP38G" sysrpl-select-38g
|
|
|
- :button (:radio . (eql :38G sysrpl-selected-calculator))))
|
|
|
+ (define-key menu-map [sysrpl-menu-select-hp50g]
|
|
|
+ '(menu-item "HP50G" sysrpl-select-hp50g
|
|
|
+ :button (:radio . (eql :HP50G sysrpl-selected-calculator))))
|
|
|
+ (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.")
|
|
|
|