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

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

[nongnu] elpa/forth-mode 0bbf7992d6 135/153: Workaround pcase bug in Ema


From: ELPA Syncer
Subject: [nongnu] elpa/forth-mode 0bbf7992d6 135/153: Workaround pcase bug in Emacs-24.3
Date: Sat, 29 Jan 2022 08:02:26 -0500 (EST)

branch: elpa/forth-mode
commit 0bbf7992d618a84f823b21de5eb36a7cb081e35f
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Helmut Eller <eller.helmut@gmail.com>

    Workaround pcase bug in Emacs-24.3
    
    * forth-smie.el (forth-smie--indentation-rules): Write patterns
    differently, as pcase in Emacs 24.3 is even buggier than usual.
---
 forth-smie.el | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/forth-smie.el b/forth-smie.el
index f008c30f48..0d085983ac 100644
--- a/forth-smie.el
+++ b/forth-smie.el
@@ -29,21 +29,21 @@
     0))
 
 (defun forth-smie--indentation-rules (kind token)
-  (pcase (list kind token)
-    (`(:elem basic) forth-smie-basic-indent)
-    (`(:elem args)
+  (pcase (cons kind token)
+    (`(:elem . basic) forth-smie-basic-indent)
+    (`(:elem . args)
      (cond ((smie-rule-prev-p ":" "begin-structure")
-           (- (+ (save-excursion
-                   (forth-smie--backward-token)
-                   (current-column))
-                 forth-smie-basic-indent)
-              (current-column)))
-          (t 0)))
-    (`(:after ,(or ":" "begin-structure"))
-     (* 2 forth-smie-basic-indent))
-    (`(:list-intro ,(or ":" "begin-structure"))
-     nil)
-    (`(:list-intro ,_) t)
+            (- (+ (save-excursion
+                    (forth-smie--backward-token)
+                    (current-column))
+                  forth-smie-basic-indent)
+               (current-column)))
+           (t 0)))
+    (`(:after . ":")               (* 2 forth-smie-basic-indent))
+    (`(:after . "begin-structure") (* 2 forth-smie-basic-indent))
+    (`(:list-intro . ":")               nil)
+    (`(:list-intro . "begin-structure") nil)
+    (`(:list-intro . ,_) t)
     (_ nil)))
 
 (defun forth-smie--forward-token ()



reply via email to

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