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

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

[nongnu] elpa/haskell-tng-mode 9a7534e 262/385: bugfixes for abbrev


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 9a7534e 262/385: bugfixes for abbrev
Date: Tue, 5 Oct 2021 23:59:43 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 9a7534e85307f35a6983396379632fbd56fa8435
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>

    bugfixes for abbrev
---
 haskell-tng-contrib-abbrev.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/haskell-tng-contrib-abbrev.el b/haskell-tng-contrib-abbrev.el
index 4807aa1..48cdb48 100644
--- a/haskell-tng-contrib-abbrev.el
+++ b/haskell-tng-contrib-abbrev.el
@@ -13,18 +13,27 @@
 (require 'skeleton)
 (require 'haskell-tng-mode)
 
+;; TODO a macro to easily define an abbrev and skeleton?
+;; TODO don't fire abbrevs in comments
+
+(abbrev-table-put
+ haskell-tng-mode-abbrev-table
+ :regexp (rx (or bol space) ;; don't fire for \case
+             (submatch (+ (not space))) point))
+
 (define-skeleton haskell-tng--skeleton-case-of
   "case...of boilerplate"
   nil "case " _ " of")
 
 (define-abbrev
   haskell-tng-mode-abbrev-table
-  "case" "" #'haskell-tng--skeleton-case-of)
+  "case" "" #'haskell-tng--skeleton-case-of
+  :system t
+  :case-fixed t)
 
 (add-hook
  'haskell-tng-mode-hook
  (lambda ()
-   ;; TODO disable the request to save the abbrev table
    (abbrev-mode 1)))
 
 (provide 'haskell-tng-contrib-abbrev)



reply via email to

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