branch: externals/javaimp
commit 11337790423647a1d5df6d6d65fe605c32a81422
Author: Filipp Gunbin <[email protected]>
Commit: Filipp Gunbin <[email protected]>

    Minor fixes
---
 javaimp-gradle.el |  6 +++---
 javaimp-maven.el  |  6 +++---
 javaimp-parse.el  | 29 ++++++++++++++---------------
 javaimp.el        | 38 +++++++++++++++++++-------------------
 4 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/javaimp-gradle.el b/javaimp-gradle.el
index b28b48ea25..f463e035ab 100644
--- a/javaimp-gradle.el
+++ b/javaimp-gradle.el
@@ -85,8 +85,8 @@ descriptor."
                (cdr (assq 'parent-id alist)))
    :file (cdr (assq 'file alist))
    :file-orig file-orig
-   :artifact (when-let ((final-name (javaimp-cygpath-convert-file-name
-                                     (cdr (assq 'final-name alist)))))
+   :artifact (when-let* ((final-name (javaimp-cygpath-convert-file-name
+                                      (cdr (assq 'final-name alist)))))
                ;; only jar/war supported
                (and (member (file-name-extension final-name) '("jar" "war"))
                     final-name))
@@ -138,7 +138,7 @@ descriptor."
          ;; in build file directory.
          (default-directory (file-name-directory file))
          ;; Prefer local gradle wrapper
-         (local-gradlew (if (eq system-type '(windows-nt))
+         (local-gradlew (if (eq system-type 'windows-nt)
                             "gradlew.bat"
                           "gradlew"))
          (program (if (file-exists-p local-gradlew)
diff --git a/javaimp-maven.el b/javaimp-maven.el
index e07fefa37e..4124233e35 100644
--- a/javaimp-maven.el
+++ b/javaimp-maven.el
@@ -51,9 +51,9 @@ resulting module trees."
     ;; Set :file slots in a separate step because Maven doesn't give
     ;; pom.xml file location for each subproject.
     (javaimp-maven--fill-modules-files file modules)
-    (when-let ((without-files (seq-filter (lambda (m)
-                                            (null (javaimp-module-file m)))
-                                          modules)))
+    (when-let* ((without-files (seq-filter (lambda (m)
+                                             (null (javaimp-module-file m)))
+                                           modules)))
       (error "Cannot find file for module(s): %s"
              (mapconcat (lambda (m)
                           (javaimp-print-id (javaimp-module-id m)))
diff --git a/javaimp-parse.el b/javaimp-parse.el
index 595da3795b..1306b0a435 100644
--- a/javaimp-parse.el
+++ b/javaimp-parse.el
@@ -144,10 +144,9 @@ Assumes point is outside of any context initially."
     res))
 
 (defun javaimp-parse--arglist (beg end &optional only-type)
-  "Parse arg list between BEG and END, of the form 'TYPE NAME,
-...'.  Return list of conses (TYPE . NAME).  If ONLY-TYPE is
-non-nil, then name parsing is skipped.  This function does not
-move point."
+  "Parse arg list between BEG and END, of the form \"TYPE NAME,
+...\".  Return list of conses (TYPE . NAME).  If ONLY-TYPE is non-nil,
+then name parsing is skipped.  This function does not move point."
   (save-excursion
     (save-restriction
       (narrow-to-region beg end)
@@ -185,12 +184,12 @@ skipping further backwards is done by the caller."
         (setq limit (point))))
     ;; Parse type: allow anything, but stop at the word boundary which
     ;; is not inside list (this is presumably the type start..)
-    (if-let ((last-skip
-              (javaimp-parse--skip-back-until
-               (lambda (_last-what last-pos)
-                 (save-excursion
-                   (if last-pos (goto-char last-pos))
-                   (looking-at "\\_<"))))))
+    (if-let* ((last-skip
+               (javaimp-parse--skip-back-until
+                (lambda (_last-what last-pos)
+                  (save-excursion
+                    (if last-pos (goto-char last-pos))
+                    (looking-at "\\_<"))))))
         (progn
           (unless (eq last-skip t)
             (goto-char (cdr last-skip))) ;undo skipping by ..-until
@@ -463,9 +462,9 @@ brace.")
         (let* ((type (intern (buffer-substring-no-properties
                               keyword-start keyword-end)))
                (attrs
-                (when-let (((eq type 'class))
-                           (decl-start
-                            (javaimp-parse--decl-prefix keyword-start)))
+                (when-let* ((_ (eq type 'class))
+                            (decl-start
+                             (javaimp-parse--decl-prefix keyword-start)))
                   (goto-char brace-pos)
                   (when (javaimp-parse--rsb-keyword
                          "\\_<abstract\\_>" decl-start t)
@@ -706,7 +705,7 @@ call this function first."
           (save-excursion
             ;; Parse as normal method scope, but don't set open-brace
             ;; because there's no body
-            (when-let ((scope (javaimp-parse--scope-method-or-stmt (point))))
+            (when-let* ((scope (javaimp-parse--scope-method-or-stmt (point))))
               (setf (javaimp-scope-parent scope) parent-scope)
               (push scope res)))
         ;; We've entered another nest, skip to its start
@@ -795,7 +794,7 @@ Scope parents are filtered according to
 then no filtering is done."
   (save-excursion
     (javaimp-parse--all-scopes))
-  (when-let ((scope (javaimp-parse--enclosing-scope pred)))
+  (when-let* ((scope (javaimp-parse--enclosing-scope pred)))
     (javaimp-scope-copy scope (unless no-filter
                                 #'javaimp-parse--scope-type-defun-p))))
 
diff --git a/javaimp.el b/javaimp.el
index bf9f6daaf2..200f9fb384 100644
--- a/javaimp.el
+++ b/javaimp.el
@@ -359,7 +359,7 @@ Finally, already parsed buffers are processed in
                                (directory-files-recursively dir "\\.java\\'")))
           files parsed-bufs unparsed-bufs)
       (dolist (s sources)
-        (if-let ((buf (get-file-buffer s)))
+        (if-let* ((buf (get-file-buffer s)))
             (if (with-current-buffer buf
                   (javaimp-parse-fully-parsed-p))
                 (push buf parsed-bufs)
@@ -397,10 +397,10 @@ Finally, already parsed buffers are processed in
   "Try to determine current root source directory from \"package\"
 directive in the current buffer.  If there's no such directive,
 then just return `default-directory'."
-  (if-let ((package (save-excursion
-                      (save-restriction
-                        (widen)
-                        (javaimp-parse-get-package)))))
+  (if-let* ((package (save-excursion
+                       (save-restriction
+                         (widen)
+                         (javaimp-parse-get-package)))))
       (string-remove-suffix
        (file-name-as-directory
         (apply #'file-name-concat (split-string package "\\." t)))
@@ -877,7 +877,7 @@ nested in methods are not included, see
                  scopes))))
 
 (defun javaimp-imenu--function (_index-name index-position scope)
-  (if-let ((decl-beg (javaimp--beg-of-defun-decl index-position)))
+  (if-let* ((decl-beg (javaimp--beg-of-defun-decl index-position)))
       (goto-char decl-beg)
     (goto-char (javaimp-scope-start scope))
     (back-to-indentation)))
@@ -1052,8 +1052,8 @@ buffer."
   (interactive "p")
   (or argp (setq argp 1))
   (when reset
-    (if-let ((pos (next-single-property-change
-                   (point-min) 'javaimp-show-scopes-markers)))
+    (if-let* ((pos (next-single-property-change
+                    (point-min) 'javaimp-show-scopes-markers)))
         (progn
           (goto-char pos)
           (forward-line -1))
@@ -1062,7 +1062,7 @@ buffer."
   (unless (get-text-property (point) 'javaimp-show-scopes-markers)
     (user-error "No more scopes"))
   ;; In case the buffer is visible in a nonselected window.
-  (when-let ((win (get-buffer-window (current-buffer) t)))
+  (when-let* ((win (get-buffer-window (current-buffer) t)))
     (set-window-point win (point)))
   (javaimp-show-scopes-goto-scope nil))
 
@@ -1226,10 +1226,10 @@ PREV-INDEX gives the index of the method itself."
 (defun javaimp-jump-to-enclosing-scope ()
   "Jump to enclosing scope at point."
   (interactive)
-  (if-let ((scope (save-excursion
-                    (save-restriction
-                      (widen)
-                      (javaimp-parse-get-enclosing-scope #'always t)))))
+  (if-let* ((scope (save-excursion
+                     (save-restriction
+                       (widen)
+                       (javaimp-parse-get-enclosing-scope #'always t)))))
       (progn
         (goto-char (or (and (javaimp-scope-type scope)
                             (not (memq (javaimp-scope-type scope)
@@ -1358,12 +1358,12 @@ any module's source file."
     ;; Forget previous tree(s) loaded from this build file, if any.
     ;; Additional project trees (see below) have the same file-orig,
     ;; so there may be several here.
-    (when-let ((existing-list
-                (seq-filter (lambda (node)
-                              (equal (javaimp-module-file-orig
-                                      (javaimp-node-contents node))
-                                    file))
-                            javaimp-project-forest)))
+    (when-let* ((existing-list
+                 (seq-filter (lambda (node)
+                               (equal (javaimp-module-file-orig
+                                       (javaimp-node-contents node))
+                                     file))
+                             javaimp-project-forest)))
       (if (y-or-n-p "Forget already loaded project(s)?")
           (setq javaimp-project-forest
                 (seq-remove (lambda (node)

Reply via email to