branch: elpa/forth-mode
commit 0bbf7992d618a84f823b21de5eb36a7cb081e35f
Author: Helmut Eller <[email protected]>
Commit: Helmut Eller <[email protected]>
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 ()