Przeglądaj źródła

Added eldoc-mode compatibility.

Paul Onions 11 lat temu
rodzic
commit
6faec172f8
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      sysrpl-mode.el

+ 5 - 2
sysrpl-mode.el

@@ -122,8 +122,9 @@
   (setq sysrpl-font-lock-keywords (sysrpl-font-lock-compile-keywords (rpl-edb-all-names :49G)))
   (sysrpl-mode))
 
-(defun sysrpl-show-stack-effect (name)
-  (message (rpl-edb-get-stack-effect sysrpl-selected-calculator name)))
+(defun sysrpl-get-eldoc-message ()
+  (interactive)
+  (rpl-edb-get-stack-effect sysrpl-selected-calculator (thing-at-point 'word)))
 
 (defun sysrpl-apropos-thing-at-point (name)
   "Show information about NAME in a popup buffer.
@@ -178,6 +179,8 @@ point."
 (define-derived-mode sysrpl-mode prog-mode "SysRPL"
   "Major mode for the SysRPL language."
   :group 'rpl
+  (make-local-variable 'eldoc-documentation-function)
+  (setq eldoc-documentation-function 'sysrpl-get-eldoc-message)
   (setq font-lock-defaults (list 'sysrpl-font-lock-keywords))
   (setq rpl-menu-compile-file-enable nil))