Skip to content

Commit 96c8bbf

Browse files
author
svein.ove
committed
Turn off adaptive fill, until it's fixed
Ignore-this: d3dd3a72d822968211b7c736889a8792 darcs-hash:20091128172449-f57bf-488039b6c5343d6952cdc3e569904a98b1ef58be.gz
1 parent 0ab0cb1 commit 96c8bbf

File tree

3 files changed

+57
-16
lines changed

3 files changed

+57
-16
lines changed

haskell-mode.el

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ Use `haskell-version' to find out what version this is.
445445
Invokes `haskell-mode-hook'."
446446
(set (make-local-variable 'paragraph-start) (concat "^$\\|" page-delimiter))
447447
(set (make-local-variable 'paragraph-separate) paragraph-start)
448+
(set (make-local-variable 'fill-paragraph-function) 'haskell-fill-paragraph)
449+
;; (set (make-local-variable 'adaptive-fill-function) 'haskell-adaptive-fill)
450+
(set (make-local-variable 'adaptive-fill-mode) nil)
448451
(set (make-local-variable 'comment-start) "-- ")
449452
(set (make-local-variable 'comment-padding) 0)
450453
(set (make-local-variable 'comment-start-skip) "[-{]-[ \t]*")
@@ -474,6 +477,30 @@ Invokes `haskell-mode-hook'."
474477
(set (make-local-variable 'tab-width) 8)
475478
(setq haskell-literate nil))
476479

480+
(defun in-comment () (nth 4 (syntax-ppss)))
481+
482+
(defun haskell-fill-paragraph (justify)
483+
(save-excursion
484+
;; We don't want to reflow code.
485+
(unless (in-comment)
486+
(end-of-line)) ; Try to get inside a comment
487+
(if (in-comment) nil t)))
488+
489+
;; (defun haskell-adaptive-fill ()
490+
;; ;; We want to use "-- " as the prefix of "-- |", etc.
491+
;; (let* ((line-end (save-excursion (end-of-line) (point)))
492+
;; (line-start (point)))
493+
;; (save-excursion
494+
;; (unless (in-comment)
495+
;; ;; Try to find the start of a comment. We only fill comments.
496+
;; (search-forward-regexp comment-start-skip line-end t))
497+
;; (when (in-comment)
498+
;; (let ();(prefix-start (point)))
499+
;; (skip-syntax-forward "^w")
500+
;; (make-string (- (point) line-start) ?\s))))))
501+
502+
503+
477504
;;;###autoload
478505
(define-derived-mode literate-haskell-mode haskell-mode "LitHaskell"
479506
"As `haskell-mode' but for literate scripts."

haskell-site-file.el

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Major mode for Haskell FFI files.
1313
;;;***
1414

1515
;;;### (autoloads (haskell-cabal-mode) "haskell-cabal" "haskell-cabal.el"
16-
;;;;;; (19171 22843))
16+
;;;;;; (19206 35523))
1717
;;; Generated autoloads from haskell-cabal.el
1818

1919
(add-to-list 'auto-mode-alist '("\\.cabal\\'" . haskell-cabal-mode))
@@ -26,7 +26,7 @@ Major mode for Cabal package description files.
2626
;;;***
2727

2828
;;;### (autoloads (haskell-decl-scan-mode) "haskell-decl-scan" "haskell-decl-scan.el"
29-
;;;;;; (19184 11012))
29+
;;;;;; (19206 35523))
3030
;;; Generated autoloads from haskell-decl-scan.el
3131

3232
(autoload 'haskell-decl-scan-mode "haskell-decl-scan" "\
@@ -76,7 +76,7 @@ Invokes `haskell-decl-scan-mode-hook'.
7676
;;;***
7777

7878
;;;### (autoloads (haskell-doc-show-type haskell-doc-mode) "haskell-doc"
79-
;;;;;; "haskell-doc.el" (19171 22859))
79+
;;;;;; "haskell-doc.el" (19206 35819))
8080
;;; Generated autoloads from haskell-doc.el
8181

8282
(autoload 'haskell-doc-mode "haskell-doc" "\
@@ -99,15 +99,16 @@ current buffer.
9999
;;;***
100100

101101
;;;### (autoloads (haskell-indent-mode) "haskell-indent" "haskell-indent.el"
102-
;;;;;; (19171 22857))
102+
;;;;;; (19206 35819))
103103
;;; Generated autoloads from haskell-indent.el
104104

105105
(autoload 'haskell-indent-mode "haskell-indent" "\
106-
``intelligent'' Haskell indentation mode that deals with
107-
the layout rule of Haskell. \\[haskell-indent-cycle] starts the cycle
108-
which proposes new possibilities as long as the TAB key is pressed.
109-
Any other key or mouse click terminates the cycle and is interpreted
110-
except for RET which merely exits the cycle.
106+
``Intelligent'' Haskell indentation mode.
107+
This deals with the layout rule of Haskell.
108+
\\[haskell-indent-cycle] starts the cycle which proposes new
109+
possibilities as long as the TAB key is pressed. Any other key
110+
or mouse click terminates the cycle and is interpreted except for
111+
RET which merely exits the cycle.
111112
Other special keys are:
112113
\\[haskell-indent-insert-equal]
113114
inserts an =
@@ -130,7 +131,7 @@ Invokes `haskell-indent-hook' if not nil.
130131
;;;***
131132

132133
;;;### (autoloads (haskell-indentation-mode) "haskell-indentation"
133-
;;;;;; "haskell-indentation.el" (19183 7319))
134+
;;;;;; "haskell-indentation.el" (19216 1488))
134135
;;; Generated autoloads from haskell-indentation.el
135136

136137
(autoload 'haskell-indentation-mode "haskell-indentation" "\
@@ -144,7 +145,7 @@ autofill-mode.
144145
;;;***
145146

146147
;;;### (autoloads (haskell-hayoo haskell-hoogle literate-haskell-mode
147-
;;;;;; haskell-mode) "haskell-mode" "haskell-mode.el" (19184 9020))
148+
;;;;;; haskell-mode) "haskell-mode" "haskell-mode.el" (19217 23751))
148149
;;; Generated autoloads from haskell-mode.el
149150

150151
(add-to-list 'load-path (or (file-name-directory load-file-name) (car load-path)))
@@ -212,8 +213,8 @@ Do a Hayoo search for QUERY.
212213

213214
;;;### (autoloads (inferior-haskell-find-haddock inferior-haskell-find-definition
214215
;;;;;; inferior-haskell-info inferior-haskell-type inferior-haskell-load-file
215-
;;;;;; switch-to-haskell) "inf-haskell" "inf-haskell.el" (19181
216-
;;;;;; 47090))
216+
;;;;;; switch-to-haskell) "inf-haskell" "inf-haskell.el" (19214
217+
;;;;;; 18334))
217218
;;; Generated autoloads from inf-haskell.el
218219

219220
(defalias 'run-haskell 'switch-to-haskell)
@@ -267,8 +268,8 @@ we load it.
267268
;;;***
268269

269270
;;;### (autoloads nil nil ("haskell-font-lock.el" "haskell-ghci.el"
270-
;;;;;; "haskell-hugs.el" "haskell-simple-indent.el") (19189 20651
271-
;;;;;; 303543))
271+
;;;;;; "haskell-hugs.el" "haskell-simple-indent.el") (19217 23753
272+
;;;;;; 561352))
272273

273274
;;;***
274275

indent.hs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,22 @@
55
-- are uselessly proposed. --
66
-------------------------------------------------------------------------
77

8+
-- | Fill-paragraph should avoid inserting an | on the following lines.
9+
10+
-- | However, indented comments should still be indented. For great justice.
11+
12+
-- * Foo bar bazFoo bar bazFoo bar bazFoo bar bazFoo bar bazFoo bar baz
13+
14+
{- Here's
15+
a more complex comment. Of doom. There is, indeed, great doom here. #-}
16+
17+
-- And a
18+
-- multi-line
19+
-- comment
20+
821
-- compute the list of binary digits corresponding to an integer
922
-- Note: the least significant bit is the first element of the list
10-
bdigits :: Int -> [Int]
23+
bdigits :: Int -> [Int] -- | commented to oblivion and back and forth and so forth
1124
bdigits 0 = [0]
1225
bdigits 1 = [1]
1326
bdigits n | n>1 = n `mod` 2 :

0 commit comments

Comments
 (0)