[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode 8e09b68 120/192: Exclusively use cl-lib to avoid
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode 8e09b68 120/192: Exclusively use cl-lib to avoid byte-compilation inconsistencies |
Date: |
Sun, 29 Aug 2021 11:02:02 -0400 (EDT) |
branch: elpa/dart-mode
commit 8e09b684ae78e6960f89d64e7368a470f7ee0c40
Author: Natalie Weizenbaum <nweiz@google.com>
Commit: Natalie Weizenbaum <nweiz@google.com>
Exclusively use cl-lib to avoid byte-compilation inconsistencies
Closes #45
---
dart-mode.el | 39 ++++++++++++++++++---------------------
1 file changed, 18 insertions(+), 21 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index 9dcb90b..eff8291 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -80,9 +80,6 @@
(require 'cc-mode)
(eval-when-compile
- (and (= emacs-major-version 24)
- (>= emacs-minor-version 4)
- (require 'cl))
(require 'cc-langs)
(require 'cc-fonts))
@@ -941,7 +938,7 @@ The constructed request will call METHOD with optional
PARAMS."
(process-send-string (dart--analysis-server-process dart--analysis-server)
(concat request "\n"))))
-(defun* dart--analysis-server-process-filter (das string)
+(cl-defun dart--analysis-server-process-filter (das string)
"Handle the event or method response from the dart analysis server.
The server DAS has STRING added to the buffer associated with it.
@@ -950,7 +947,7 @@ the callback for that request is given the json decoded
response."
(-let [buf (dart--analysis-server-buffer das)]
;; The buffer may have been killed if the server was restarted
(unless (buffer-live-p buf)
- (return-from dart--analysis-server-process-filter))
+ (cl-return-from dart--analysis-server-process-filter))
;; We use a buffer here because emacs might call the filter before the
;; entire line has been written out. In this case we store the
@@ -1154,7 +1151,7 @@ minibuffer."
(if (dart--at-end-of-function-name-p) 'font-lock-function-name-face
'font-lock-type-face))
- (case (char-after)
+ (cl-case (char-after)
;; Foo.bar()
(?.
(forward-char)
@@ -1174,7 +1171,7 @@ minibuffer."
(defun dart--at-end-of-function-name-p ()
"Returns whether the point is at the end of a function name."
- (case (char-after)
+ (cl-case (char-after)
(?\( t)
(?<
(and (looking-at (concat "\\(" dart--identifier-re "\\|[<>]\\)*"))
@@ -1403,23 +1400,23 @@ stayas in place when the parameter is overwritten.")
(defvar dart--last-expand-subscription nil
"The last analysis server subscription from a call to `dart-expand'.")
-(defun* dart-expand ()
+(cl-defun dart-expand ()
"Expand previous word using Dart's autocompletion."
(interactive "*")
(unless dart-enable-analysis-server
(call-interactively dart-expand-fallback t)
- (return-from dart-expand))
+ (cl-return-from dart-expand))
(when (and (memq last-command '(dart-expand dart-expand-parameters))
dart--last-expand-results)
- (incf dart--last-expand-index)
+ (cl-incf dart--last-expand-index)
(when (>= dart--last-expand-index (length dart--last-expand-results))
(setq dart--last-expand-index 0))
(dart--use-expand-suggestion
dart--last-expand-beginning
dart--last-expand-end
(elt dart--last-expand-results dart--last-expand-index))
- (return-from dart-expand))
+ (cl-return-from dart-expand))
(when dart--last-expand-subscription
(dart--analysis-server-unsubscribe dart--last-expand-subscription))
@@ -1517,7 +1514,7 @@ If FIRST is non-nil, this is the first completion event
for this completion."
(insert parameters)
(insert " → " return-type))
- (case kind
+ (cl-case kind
("GETTER" (insert "get "))
("SETTER" (insert "set ")))
(insert name)
@@ -1526,7 +1523,7 @@ If FIRST is non-nil, this is the first completion event
for this completion."
(when return-type (insert " → " return-type)))
(buffer-string))))
-(defun* dart-expand-parameters ()
+(cl-defun dart-expand-parameters ()
"Adds parameters to the currently-selected `dart-expand' completion.
This will select the first parameter, if one exists."
@@ -1542,21 +1539,21 @@ This will select the first parameter, if one exists."
((parameter-names parameterNames)
(argument-string defaultArgumentListString)
(argument-ranges defaultArgumentListTextRanges))
- (unless parameter-names (return-from dart-expand-parameters))
+ (unless parameter-names (cl-return-from dart-expand-parameters))
(unless argument-string
(insert ?\()
(save-excursion
(insert ?\))
(setq dart--last-expand-end (point-marker)))
- (return-from dart-expand-parameters))
+ (cl-return-from dart-expand-parameters))
(save-excursion
(insert ?\( argument-string ?\))
(setq dart--last-expand-end (point-marker)))
(setq dart--last-expand-parameters-ranges
- (loop for i below (length argument-ranges) by 2
+ (cl-loop for i below (length argument-ranges) by 2
collect (let* ((beginning (+ (point) 1 (elt argument-ranges
i)))
(end (+ beginning (elt argument-ranges (+ i
1)) 1)))
(list (copy-marker beginning) (copy-marker end)))))
@@ -1569,7 +1566,7 @@ This will select the first parameter, if one exists."
;; If this is called when the point is within the text generated by the
;; last `dart-expand-parameters' call, move to the next parameter in the
;; list.
- (incf dart--last-expand-parameters-index)
+ (cl-incf dart--last-expand-parameters-index)
(when (>= dart--last-expand-parameters-index (length
dart--last-expand-parameters-ranges))
(setq dart--last-expand-parameters-index 0))
@@ -1706,7 +1703,7 @@ See `compilation-error-regexp-alist' for help on their
format.")
(cons 'dart-formatter dart--formatter-compilation-regexp))
(add-to-list 'compilation-error-regexp-alist 'dart-formatter)
-(defun* dart-format ()
+(cl-defun dart-format ()
"Format the current buffer using the Dart formatter.
By default, this uses the formatter in `dart-sdk-path'. However,
@@ -1737,7 +1734,7 @@ this can be overridden by customizing
(message "Formatting failed")
(when error-buffer
(dart--formatter-show-errors error-buffer file
(buffer-file-name)))
- (return-from dart-format))
+ (cl-return-from dart-format))
;; Apply the format as a diff so that only portions of the buffer
that
;; actually change are marked as modified.
@@ -1779,7 +1776,7 @@ this can be overridden by customizing
(forward-line len)
(-let [text (buffer-substring start (point))]
(with-current-buffer target-buffer
- (decf line-offset len)
+ (cl-decf line-offset len)
(goto-char (point-min))
(forward-line (- from len line-offset))
(insert text)))))
@@ -1788,7 +1785,7 @@ this can be overridden by customizing
(with-current-buffer target-buffer
(goto-char (point-min))
(forward-line (- from line-offset 1))
- (incf line-offset len)
+ (cl-incf line-offset len)
(let (kill-ring) (kill-whole-line len))))
(t
- [nongnu] elpa/dart-mode 1ccf8a0 073/192: Better handling and of analysis server messages., (continued)
- [nongnu] elpa/dart-mode 1ccf8a0 073/192: Better handling and of analysis server messages., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a4d7a3c 075/192: Declare compatibility with flycheck 0.23., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1b75622 079/192: Only mention marmalade in the README., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e338148 078/192: Get rid of busted flymake and formatter support., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 05fbd30 081/192: Merge pull request #24 from phst/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode bd08208 082/192: Switch completely to cl-lib (#33), ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1f65c88 083/192: Add LIMIT argument for looking-back (#34), ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1c9da5a 087/192: Explicitly load compile.el so that the compilation-error-regexp-* variables are defined (#41), ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode eea1000 093/192: Highlight hover dartdoc, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 907cba5 095/192: Indicate deprecated hovers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 8e09b68 120/192: Exclusively use cl-lib to avoid byte-compilation inconsistencies,
ELPA Syncer <=
- [nongnu] elpa/dart-mode 1249417 108/192: Better handle zero-argument functions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 0277dad 107/192: Include parameter documentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 73d0ebc 135/192: Merge branch 'refactor-tests', ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 4feac34 123/192: Make sure to provide the full buffer in dart-add-analysis-overlay, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e01234a 113/192: Use funcall rather than apply where appropriate, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode eba375b 112/192: Parse JSON arrays as lists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 905ce53 117/192: Fix a bunch of byte-compilation warnings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 25a0b8a 128/192: Add tests for dart-format, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d1a0c5e 103/192: Fall back to normal expansion, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 613b311 111/192: Stop using lexical let, ELPA Syncer, 2021/08/29