[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode f6a1c9a79 171/192: Fix byte-compiling errors and
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode f6a1c9a79 171/192: Fix byte-compiling errors and warnings |
Date: |
Sun, 29 Aug 2021 11:02:12 -0400 (EDT) |
branch: elpa/dart-mode
commit f6a1c9a799ed60c7cfeeb7865a8b7b967af53b6e
Author: Ivan Inozemtsev <iinozemtsev@google.com>
Commit: Ivan Inozemtsev <iinozemtsev@google.com>
Fix byte-compiling errors and warnings
- Remove references to `dart-in-block-p` (which was removed in 199709f)
- Wrap `defun dart--identifier` with `eval-and-compile`, as `rx` macro is
executed during compilation
- Remove unused `syntax` variable from let block
- Add missing type to `defcustom dart-font-lock-extra-types`
- Wrap references to flycheck functions and variables with `fboundp` and
`boundp`
Fixes #100
---
dart-mode.el | 48 +++++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 23 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index 5d63343..8406b0f 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -114,8 +114,7 @@ true for positions before the start of the statement, but
on its line."
while (looking-at "^ *$"))
(skip-syntax-backward " ")
(cl-case (char-before)
- ((?} ?\;) t)
- ((?{) (dart-in-block-p (c-guess-basic-syntax))))))))
+ ((?} ?\;) t))))))
(defun dart--delete-whole-line (&optional arg)
"Delete the current line without putting it in the `kill-ring'.
@@ -365,7 +364,7 @@ indentation levels from right to left."
(while t
(when (= (point) 1)
(throw 'done t))
- (previous-line)
+ (forward-line -1)
(unless (looking-at (rx (and bol (zero-or-more space) eol)))
(setq prev-line t)
(setq prev-indent (current-indentation))
@@ -427,13 +426,13 @@ indentation levels from right to left."
(?A . ?F)
digit)))))
-(defun dart--identifier (&optional case)
- `(and (or word-start symbol-start)
- (zero-or-more (any ?$ ?_))
- ,(if case
- case
- 'alpha)
- (zero-or-more (or ?$ ?_ alnum))))
+(eval-and-compile (defun dart--identifier (&optional case)
+ `(and (or word-start symbol-start)
+ (zero-or-more (any ?$ ?_))
+ ,(if case
+ case
+ 'alpha)
+ (zero-or-more (or ?$ ?_ alnum)))))
(defvar dart--metadata-re (rx ?@ (eval (dart--identifier))))
@@ -480,7 +479,7 @@ These have the form ${expression}.
Can fontify entire match with group 0, or using group 1 for sigil,
groups 2 and 4 for curly brackets, and 3 for contents."
(catch 'result
- (let (sigil beg open close end syntax depth)
+ (let (sigil beg open close end depth)
;; Loop and put point after ${
(while (and (search-forward "${" limit t)
;; Check that we are in a string and not in a raw string
@@ -640,6 +639,7 @@ fontify as declared variables. From ECMA-408,
variableDeclaration:
declaredIdentifier (', ' identifier)*
;"
+ (ignore limit)
(catch 'result
(let ((depth (car (syntax-ppss))))
(while t
@@ -802,7 +802,8 @@ whichever comes first."
(defcustom dart-font-lock-extra-types nil
"*List of extra types (aside from the type keywords) to recognize in DART
mode.
Each list item should be a regexp matching a single identifier."
- :group 'dart-mode)
+ :group 'dart-mode
+ :type '(list regexp))
;;; Dart analysis server
@@ -901,8 +902,8 @@ directory or the current file directory to the analysis
roots."
(add-hook 'first-change-hook 'dart-add-analysis-overlay t t)
(add-hook 'after-change-functions 'dart-change-analysis-overlay t t)
(add-hook 'after-save-hook 'dart-remove-analysis-overlay t t)
- (when (featurep 'flycheck)
- (add-to-list 'flycheck-checkers 'dart-analysis-server)))
+ (when (boundp 'flycheck-checkers)
+ (add-to-list 'flycheck-checkers 'dart-analysis-server)))
(defun dart-start-analysis-server ()
"Start the Dart analysis server.
@@ -1144,7 +1145,7 @@ SUBSCRIPTION is an opaque object provided by
(lambda (response)
(dart--report-errors response buffer callback)))))
-(when (featurep 'flycheck)
+(when (fboundp 'flycheck-define-generic-checker)
(flycheck-define-generic-checker
'dart-analysis-server
"Checks Dart source code for errors using Dart analysis server."
@@ -1164,14 +1165,15 @@ reported to CALLBACK."
(defun dart--to-flycheck-err (err buffer)
"Create a flycheck error from a dart ERR in BUFFER."
- (flycheck-error-new
- :buffer buffer
- :checker 'dart-analysis-server
- :filename (dart--get err 'location 'file)
- :line (dart--get err 'location 'startLine)
- :column (dart--get err 'location 'startColumn)
- :message (dart--get err 'message)
- :level (dart--severity-to-level (dart--get err 'severity))))
+ (when (fboundp 'flycheck-error-new)
+ (flycheck-error-new
+ :buffer buffer
+ :checker 'dart-analysis-server
+ :filename (dart--get err 'location 'file)
+ :line (dart--get err 'location 'startLine)
+ :column (dart--get err 'location 'startColumn)
+ :message (dart--get err 'message)
+ :level (dart--severity-to-level (dart--get err 'severity)))))
(defun dart--severity-to-level (severity)
"Convert SEVERITY to a flycheck level."
- [nongnu] elpa/dart-mode 2b085f5 125/192: Do not fail if Flycheck is not available. (#52), (continued)
- [nongnu] elpa/dart-mode 2b085f5 125/192: Do not fail if Flycheck is not available. (#52), ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c973dea 127/192: Require ‘help-mode’., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 68f7f4f 132/192: Require cl for emacs 24.4, 24.5, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode caa7a19 124/192: Don't error out with revert-buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 199709f 148/192: Removes cc-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode da244c6 144/192: Fixes no such file or directory, dartfmt.exe, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9db2679 143/192: Fixes invalid file path format on Windows, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 06e2d4b 160/192: Respect font-lock-maximum-decoration, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 3082066 185/192: Don't font lock anchor in a string, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode ad93bc1 165/192: Edit headers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode f6a1c9a79 171/192: Fix byte-compiling errors and warnings,
ELPA Syncer <=
- [nongnu] elpa/dart-mode 1273ccb 191/192: Make changes to list of dart-mode keywords easier to diff, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a9899a9 182/192: Fontify abstract methods, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c523992 004/192: Handle map indentation with identifiers., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 30f9326 007/192: Make constants better., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 5ce38b7 009/192: Add a couple known bugs., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 64a573f 010/192: Require 'cl when compiling., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode b42c2ca 014/192: Another known bug., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 4d67ba8 017/192: Fix the closing comment., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1473515 019/192: Bump to version 0.3 for release., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 06c2786 024/192: Bump version to 0.4., ELPA Syncer, 2021/08/29