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

[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



reply via email to

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