Skip to content

Commit 03fb950

Browse files
authored
Merge pull request #1635 from david-christiansen/issue/1627
haskell-cabal-mode: Add support for common-stanzas
2 parents 2ac4a7c + e594668 commit 03fb950

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

haskell-cabal.el

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ By default these are:
7070
'("name" "version" "cabal-version" "license" "license-file" "copyright"
7171
"author" "maintainer" "stability" "homepage" "package-url" "synopsis"
7272
"description" "category" "tested-with" "build-depends" "data-files"
73-
"extra-source-files" "extra-tmp-files"))
73+
"extra-source-files" "extra-tmp-files" "import"))
7474

7575
(defconst haskell-cabal-library-fields
7676
;; Extracted with (haskell-cabal-extract-fields-from-doc "library")
@@ -102,7 +102,7 @@ By default these are:
102102
'(("^[ \t]*--.*" . font-lock-comment-face)
103103
("^ *\\([^ \t:]+\\):" (1 font-lock-keyword-face))
104104
("^\\(Library\\)[ \t]*\\({\\|$\\)" (1 font-lock-keyword-face))
105-
("^\\(Executable\\|Test-Suite\\|Benchmark\\)[ \t]+\\([^\n \t]*\\)"
105+
("^\\(Executable\\|Test-Suite\\|Benchmark\\|Common\\)[ \t]+\\([^\n \t]*\\)"
106106
(1 font-lock-keyword-face) (2 font-lock-function-name-face))
107107
("^\\(Flag\\)[ \t]+\\([^\n \t]*\\)"
108108
(1 font-lock-keyword-face) (2 font-lock-constant-face))
@@ -153,6 +153,7 @@ it from list if one of the following conditions are hold:
153153
(define-key map (kbd "M-g l") 'haskell-cabal-goto-library-section)
154154
(define-key map (kbd "M-g e") 'haskell-cabal-goto-executable-section)
155155
(define-key map (kbd "M-g b") 'haskell-cabal-goto-benchmark-section)
156+
(define-key map (kbd "M-g o") 'haskell-cabal-goto-common-section)
156157
(define-key map (kbd "M-g t") 'haskell-cabal-goto-test-suite-section)
157158
map))
158159

@@ -1009,6 +1010,9 @@ Source names from main-is and c-sources sections are left untouched
10091010
(interactive)
10101011
(haskell-cabal-goto-section-type "benchmark"))
10111012

1013+
(defun haskell-cabal-goto-common-section ()
1014+
(interactive)
1015+
(haskell-cabal-goto-section-type "common"))
10121016

10131017

10141018
(defun haskell-cabal-line-entry-column ()

0 commit comments

Comments
 (0)