Skip to content

Commit 26135bc

Browse files
author
Marcus Geiger
committed
Fix cl invocations by prefixing them with cl-
Newer Emacs (24.3) requires 'cl-lib to use cl- stuff. Add cl- prefix to cl functions/macro invocations.
1 parent 2a22b3f commit 26135bc

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lsp-java.el

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
(require 'f)
3030
(require 'tree-widget)
3131
(require 'request)
32+
(require 'cl-lib)
3233

3334
(defgroup lsp-java nil
3435
"JDT emacs frontend."
@@ -560,10 +561,10 @@ NOT-FOUND-MESSAGE will be used if there is no matching action."
560561
(let ((actions (cl-remove-if-not
561562
(lambda (item) (string-match regexp (gethash "title" item)))
562563
(lsp-get-or-calculate-code-actions))))
563-
(case (length actions)
564+
(pcase (length actions)
564565
(0 (error (or not-found-message "Unable to find action")))
565566
(1 (lsp-execute-code-action (car actions)))
566-
(t (lsp-execute-code-action (lsp--select-action actions))))))
567+
(_ (lsp-execute-code-action (lsp--select-action actions))))))
567568

568569
(defun lsp-java-extract-to-local-variable (arg)
569570
"Extract local variable refactoring.
@@ -844,13 +845,13 @@ PROJECT-URI uri of the item."
844845

845846
(cl-defmethod lsp-execute-command
846847
((_server (eql jdtls)) (command (eql java.show.references)) params)
847-
(if-let (refs (third params))
848+
(if-let (refs (cl-third params))
848849
(xref--show-xrefs (lsp--locations-to-xref-items refs) nil)
849850
(user-error "No references")))
850851

851852
(cl-defmethod lsp-execute-command
852853
((_server (eql jdtls)) (command (eql java.show.implementations)) params)
853-
(if-let (refs (third params))
854+
(if-let (refs (cl-third params))
854855
(xref--show-xrefs (lsp--locations-to-xref-items refs) nil)
855856
(user-error "No implementations")))
856857

@@ -897,10 +898,10 @@ PROJECT-URI uri of the item."
897898
:headers '(("Accept" . "application/vnd.initializr.v2.1+json"))
898899
:success (cl-function
899900
(lambda (&key data &allow-other-keys)
900-
(flet ((ask (message key) (alist-get 'id
901-
(lsp--completing-read message
902-
(alist-get 'values (alist-get key data))
903-
(-partial 'alist-get 'name)))))
901+
(cl-flet ((ask (message key) (alist-get 'id
902+
(lsp--completing-read message
903+
(alist-get 'values (alist-get key data))
904+
(-partial 'alist-get 'name)))))
904905
(condition-case _err
905906
(-let* ((group-id (read-string "Enter group name: " "com.example"))
906907
(artifact-id (read-string "Enter artifactId: " "demo"))
@@ -934,7 +935,7 @@ PROJECT-URI uri of the item."
934935
rest))
935936
(if (-contains? deps dep)
936937
(setq deps (remove dep deps))
937-
(pushnew dep deps)))
938+
(cl-pushnew dep deps)))
938939
(let ((download-url (format "%sstarter.zip?type=%s&language=%s&groupId=%s&artifactId=%s&packaging=%s&bootVersion=%s&baseDir=%s&dependencies=%s"
939940
base-url type language group-id artifact-id packaging boot-version artifact-id (s-join "," deps))))
940941
(message "Downloading template from %s" download-url)

0 commit comments

Comments
 (0)