]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle `let-alist' double-dot escape
authorEshel Yaron <me@eshelyaron.com>
Sun, 26 Jan 2025 07:55:39 +0000 (08:55 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 26 Jan 2025 07:55:39 +0000 (08:55 +0100)
lisp/emacs-lisp/scope.el

index 142f9da6f6f9a437da55cb4301299dc8faca1303..2615661879bb2b437fc9fe8d7d62d43a7fe7cd01 100644 (file)
@@ -62,9 +62,14 @@ Optional argument LOCAL is a local context to extend."
       (cond
        ((keywordp bare) (scope-report 'constant beg len))
        ((and scope-current-let-alist-form (= (aref name 0) ?.))
-        (scope-report 'variable beg len
-                      (list 'let-alist (car scope-current-let-alist-form) bare)
-                      (cdr scope-current-let-alist-form)))
+        (if (and (length> name 1) (= (aref name 1) ?.))
+            ;; Double dot espaces `let-alist'.
+            (let* ((unescaped (intern (substring name 1)))
+                   (id (alist-get unescaped local)))
+              (scope-report 'variable beg len id))
+          (scope-report 'variable beg len
+                        (list 'let-alist (car scope-current-let-alist-form) bare)
+                        (cdr scope-current-let-alist-form))))
        (t
         (let ((id (alist-get bare local)))
           (scope-report 'variable beg len id)))))))