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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-mode 810b08e317 7/7: Merge pull request #1760 from


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-mode 810b08e317 7/7: Merge pull request #1760 from mattiase/cull-markers
Date: Fri, 3 Mar 2023 13:01:21 -0500 (EST)

branch: elpa/haskell-mode
commit 810b08e317ba3b645c05da2cdea9069145924640
Merge: 922f730cbd abce84fef3
Author: Steve Purcell <steve@sanityinc.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #1760 from mattiase/cull-markers
    
    Reduce (over)use of markers (#1751)
---
 haskell-lexeme.el | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/haskell-lexeme.el b/haskell-lexeme.el
index 49a02fcd3c..a00838ce20 100644
--- a/haskell-lexeme.el
+++ b/haskell-lexeme.el
@@ -98,7 +98,7 @@ Returns:
 After successful \\='qid or \\='qsym match (match-string 1) will return
 the unqualified part (if any)."
   (let ((begin (point))
-        (match-data-old (match-data)))
+        (match-data-old (match-data t)))
     (save-excursion
       (while (looking-at (concat haskell-lexeme-modid "\\."))
         (goto-char (match-end 0)))
@@ -138,7 +138,7 @@ When match is successful, match-data will contain:
   (match-text 2) - whole qualified identifier
   (match-text 3) - unqualified part of identifier
   (match-text 4) - closing backtick"
-  (let ((match-data-old (match-data))
+  (let ((match-data-old (match-data t))
         first-backtick-start
         last-backtick-start
         qid-start
@@ -159,15 +159,12 @@ When match is successful, match-data will contain:
           (when (looking-at "`")
             (setq last-backtick-start (match-beginning 0))
             (set-match-data
-             (mapcar
-              (lambda (p)
-                (set-marker (make-marker) p))
-              (list
-               first-backtick-start (1+ last-backtick-start)
-               first-backtick-start (1+ first-backtick-start)
-               qid-start id-end
-               id-start id-end
-               last-backtick-start (1+ last-backtick-start))))
+             (list
+              first-backtick-start (1+ last-backtick-start)
+              first-backtick-start (1+ first-backtick-start)
+              qid-start id-end
+              id-start id-end
+              last-backtick-start (1+ last-backtick-start)))
             (setq result t)))))
     (unless result
       (set-match-data match-data-old))
@@ -370,7 +367,7 @@ Regexp has subgroup expressions:
 
 Note that this function excludes \\='e\\=', \\='t\\=', \\='d'\\=, \\='p\\='
 as quoter names according to Template Haskell specification."
-  (let ((match-data-old (match-data)))
+  (let ((match-data-old (match-data t)))
     (if (and
          (looking-at (rx-to-string `(: "[" (optional "$")
                                        (regexp 
,haskell-lexeme-modid-opt-prefix)
@@ -383,9 +380,9 @@ as quoter names according to Template Haskell 
specification."
         ;; note that quasi quote syntax does not have any escaping
         ;; mechanism and if not closed it will span til lthe end of buffer
         (goto-char (match-end 0))
-        (let ((match-data (match-data))
+        (let ((match-data (match-data t))
               (match-data-2 (and (re-search-forward "|]" nil t)
-                                 (match-data))))
+                                 (match-data t))))
           (if match-data-2
               (set-match-data
                (list
@@ -474,20 +471,20 @@ See `haskell-lexeme-classify-by-first-char' for details."
             (> (skip-chars-forward "\n") 0))))
   (let
       ((case-fold-search nil)
-       (point (point-marker)))
+       (point (point)))
     (or
      (and
       (equal (string-to-syntax "<")
              (get-char-property (point) 'syntax-table))
       (progn
-        (set-match-data (list point (set-marker (make-marker) 
(line-end-position))))
+        (set-match-data (list point (line-end-position)))
         'literate-comment))
      (and (looking-at "\n")
           'newline)
      (and (looking-at "{-")
           (save-excursion
             (forward-comment 1)
-            (set-match-data (list point (point-marker)))
+            (set-match-data (list point (point)))
             'nested-comment))
      (and (haskell-lexeme-looking-at-char-literal)
           'char)
@@ -501,7 +498,7 @@ See `haskell-lexeme-classify-by-first-char' for details."
           (if (save-match-data
                 (string-match "\\`---*\\'" (match-string-no-properties 0)))
               (progn
-                (set-match-data (list point (set-marker (make-marker) 
(line-end-position))))
+                (set-match-data (list point (line-end-position)))
                 'comment)
             'qsymid))
      (and (looking-at haskell-lexeme-number)



reply via email to

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