[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 8cc1017 12/15: Rename relint--pos-from-toplevel-
From: |
Mattias Engdegård |
Subject: |
[elpa] externals/relint 8cc1017 12/15: Rename relint--pos-from-toplevel-pos-path |
Date: |
Sat, 29 Feb 2020 17:22:30 -0500 (EST) |
branch: externals/relint
commit 8cc1017036d524b7c51860aaa36191925dc31f1a
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Rename relint--pos-from-toplevel-pos-path
The starting position need not be at top level.
---
relint-test.el | 2 +-
relint.el | 16 +++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/relint-test.el b/relint-test.el
index 9b835b1..05bb8a4 100644
--- a/relint-test.el
+++ b/relint-test.el
@@ -79,7 +79,7 @@ and a path."
(dolist (item (relint-test--enumerate-nodes toplevel-form nil))
(let* ((node (car item))
(path (cdr item))
- (pos (relint--pos-from-toplevel-pos-path toplevel-pos path)))
+ (pos (relint--pos-from-start-pos-path toplevel-pos path)))
;; Skip sugared items; they cannot be read in isolation.
(unless (memq node '(quote function \` \, \,@))
(goto-char pos)
diff --git a/relint.el b/relint.el
index fc06746..bbda180 100644
--- a/relint.el
+++ b/relint.el
@@ -110,7 +110,9 @@
(defun relint--follow-path (path)
"Move point forward along PATH (reversed list of list indices
-to follow to target)."
+to follow to target).
+For example, if point is before the form (A B (C ((D E F G))))
+and PATH is (3 0 1 2), then the returned position is right before G."
(let ((p (reverse path)))
(while p
(relint--skip-whitespace)
@@ -141,11 +143,11 @@ to follow to target)."
(setq p (cdr p))))
(relint--skip-whitespace))
-(defun relint--pos-from-toplevel-pos-path (toplevel-pos path)
- "Compute position from TOPLEVEL-POS and PATH (reversed list of
+(defun relint--pos-from-start-pos-path (start-pos path)
+ "Compute position from START-POS and PATH (reversed list of
list indices to follow to target)."
(save-excursion
- (goto-char toplevel-pos)
+ (goto-char start-pos)
(relint--follow-path path)
(point)))
@@ -193,7 +195,7 @@ or nil if no position could be determined."
(setq args (cdr args)))
(and args (stringp (car args))
(let ((string-pos
- (relint--pos-from-toplevel-pos-path pos (list index))))
+ (relint--pos-from-start-pos-path pos (list index))))
(relint--literal-string-pos string-pos n))))))))
(defun relint--suppression (pos message)
@@ -247,8 +249,8 @@ or nil if no position could be determined."
"Function accepting a found complaint, taking the arguments
(FILE POS MESSAGE STRING STRING-IDX).")
-(defun relint--report (file toplevel-pos path message &optional str str-pos)
- (let* ((base-pos (relint--pos-from-toplevel-pos-path toplevel-pos path))
+(defun relint--report (file start-pos path message &optional str str-pos)
+ (let* ((base-pos (relint--pos-from-start-pos-path start-pos path))
(pos (or (and str-pos (relint--string-pos base-pos str-pos))
base-pos)))
(if (relint--suppression pos message)
- [elpa] externals/relint updated (3315f03 -> c2d3f3b), Mattias Engdegård, 2020/02/29
- [elpa] externals/relint 55070de 02/15: Update copyright year to 2020, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint a2a29d6 03/15: Scan arguments to search-{forward, backward}-regexp, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint c733b47 05/15: Use text quoting for all messages, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint b46ee8b 04/15: Update copyright year to 2020, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint bb7d8a1 10/15: Fix mistake in previous commit, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint 1741e2c 09/15: Locate error position in 'concat' forms, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint 8cc1017 12/15: Rename relint--pos-from-toplevel-pos-path,
Mattias Engdegård <=
- [elpa] externals/relint 9de65a6 11/15: Remove package description in relint.el, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint c33b893 06/15: Refactor error reporting, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint 803579c 01/15: More font-lock-keywords detection, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint 47490f3 08/15: Add relint-buffer for easier use of relint as a library, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint 159a210 13/15: Simplify line/column computation and reindent, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint c2d3f3b 15/15: Increment version to 1.14, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint 4a8b0ef 14/15: Return position of both expression and error from relint-buffer, Mattias Engdegård, 2020/02/29
- [elpa] externals/relint 7b93662 07/15: Report error position inside string literals, Mattias Engdegård, 2020/02/29