Strip "my/" prefix. Require 'json' library.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 09 Mar 2017 15:11:29 +0200
changeset 1506 4f24c53e6e38
parent 1505 4f43f768473f
child 1507 6f939639c52a
Strip "my/" prefix. Require 'json' library.
spring-actuator.el
--- a/spring-actuator.el	Thu Mar 09 11:07:23 2017 +0200
+++ b/spring-actuator.el	Thu Mar 09 15:11:29 2017 +0200
@@ -1,16 +1,18 @@
 
-(defvar my/spring-actuator-server-history nil)
-(defvar my/spring-actuator-last-server "http://localhost:8080")
-(defvar my/spring-actuator-path-history nil)
-(defvar my/spring-actuator-path-completion
+(require 'json)
+
+(defvar spring-actuator-server-history nil)
+(defvar spring-actuator-last-server "http://localhost:8080")
+(defvar spring-actuator-path-history nil)
+(defvar spring-actuator-path-completion
   '("actuator" "auditevents" "autoconfig" "beans" "configprops" "dump" "env" "features" "flyway" "health" "heapdump"
     "info" "jolokia" "liquibase" "logfile" "loggers" "mappings" "metrics" "trace"))
 
 ;;;###autoload
-(defun my/spring-actuator (server path)
-  (interactive (list (read-string "Server: " my/spring-actuator-last-server 'my/spring-actuator-server-history)
-                     (completing-read "Path: " my/spring-actuator-path-completion nil nil "" 'my/spring-actuator-path-history)))
-  (setq my/spring-actuator-last-server server)
+(defun spring-actuator (server path)
+  (interactive (list (read-string "Server: " spring-actuator-last-server 'spring-actuator-server-history)
+                     (completing-read "Path: " spring-actuator-path-completion nil nil "" 'spring-actuator-path-history)))
+  (setq spring-actuator-last-server server)
   (let ( (bufname (format "actuator: %s" path)) )
     (when (get-buffer bufname)
       (kill-buffer bufname))
@@ -26,3 +28,5 @@
         (json-mode)
       (js-mode))
     (setq-local js-indent-level 2)))
+
+(provide 'spring-actuator)