emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/javaimp e1e233e: Improve javaimp-help-show-scopes


From: Filipp Gunbin
Subject: [elpa] externals/javaimp e1e233e: Improve javaimp-help-show-scopes
Date: Tue, 10 Aug 2021 14:53:06 -0400 (EDT)

branch: externals/javaimp
commit e1e233ed3e04a00f321dd2c64510a743fa4bbfa2
Author: Filipp Gunbin <fgunbin@fastmail.fm>
Commit: Filipp Gunbin <fgunbin@fastmail.fm>

    Improve javaimp-help-show-scopes
---
 javaimp-util.el | 12 ++++++++++++
 javaimp.el      | 12 ++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/javaimp-util.el b/javaimp-util.el
index d058e82..588e8bf 100644
--- a/javaimp-util.el
+++ b/javaimp-util.el
@@ -42,6 +42,18 @@
    '(anonymous-class statement simple-statement array unknown)
    javaimp--named-scope-types))
 
+(defconst javaimp--help-scope-type-abbrevs
+  '((anonymous-class . "ac")
+    (statement . "st")
+    (simple-statement . "ss")
+    (array . "ar")
+    (unknown . "un")
+    (local-class . "lc")
+    (method . "me")
+    (class . "cl")
+    (interface . "in")
+    (enum . "en")))
+
 
 
 ;; Structs
diff --git a/javaimp.el b/javaimp.el
index e6cae7a..4b69d71 100644
--- a/javaimp.el
+++ b/javaimp.el
@@ -719,11 +719,9 @@ start (`javaimp-scope-start') instead."
                        (javaimp-scope-start scope)
                      (javaimp-scope-open-brace scope)))))))
 
-
-(defun javaimp-help-reparse-and-show-scopes ()
-  "Reparse scopes and show them in a *javaimp-scopes* buffer."
+(defun javaimp-help-show-scopes ()
+  "Show scopes in a *javaimp-scopes* buffer."
   (interactive)
-  (setq javaimp--parse-dirty-pos (point-min))
   (let ((scopes (save-excursion
                   (javaimp--parse-get-all-scopes)))
         (file buffer-file-name)
@@ -739,9 +737,11 @@ start (`javaimp-scope-start') instead."
           (while (setq tmp (javaimp-scope-parent tmp))
             (setq depth (1+ depth)))
           (insert (propertize
-                   (format "%d: %010s %s\n"
+                   (format "%d %s: %s%s\n"
                            depth
-                           (symbol-name (javaimp-scope-type scope))
+                           (cdr (assq (javaimp-scope-type scope)
+                                      javaimp--help-scope-type-abbrevs))
+                           (make-string depth ? )
                            (javaimp-scope-name scope))
                    'mouse-face 'highlight
                    'help-echo "mouse-2: go to this scope"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]