Skip to content

Commit b46db25

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/pr/339'
2 parents d1ef416 + c388f0a commit b46db25

21 files changed

+326
-331
lines changed

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ ELCHECKS=$(addprefix check-, $(ELFILES:.el=))
5050

5151
%.elc: %.el
5252
@$(BATCH) \
53-
--eval "(byte-compile-disable-warning 'cl-functions)" \
5453
-f batch-byte-compile $<
5554

5655
.PHONY: all compile info clean check $(ELCHECKS) elpa package
@@ -63,7 +62,6 @@ $(ELCHECKS): check-%: %.el
6362
@$(BATCH) --eval '(when (check-declare-file "$*.el") (error "check-declare failed"))'
6463
@$(BATCH) \
6564
--eval "(setq byte-compile-error-on-warn t)" \
66-
--eval "(byte-compile-disable-warning 'cl-functions)" \
6765
-f batch-byte-compile $*.el
6866
@$(RM) $*.elc
6967
@if [ -f "$(<:%.el=tests/%-tests.el)" ]; then \
@@ -121,6 +119,6 @@ $(AUTOLOADS): $(ELFILES) haskell-mode.elc
121119
# HACK: embed version number into .elc file
122120
haskell-mode.elc: haskell-mode.el
123121
$(SUBST_ATAT) < haskell-mode.el > haskell-mode.tmp.el
124-
@$(BATCH) --eval "(byte-compile-disable-warning 'cl-functions)" -f batch-byte-compile haskell-mode.tmp.el
122+
@$(BATCH) -f batch-byte-compile haskell-mode.tmp.el
125123
mv haskell-mode.tmp.elc haskell-mode.elc
126124
$(RM) haskell-mode.tmp.el

haskell-align-imports.el

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595

9696
;;; Code:
9797

98-
(with-no-warnings (require 'cl))
98+
(require 'cl-lib)
9999

100100
(defvar haskell-align-imports-regexp
101101
(concat "^\\(import[ ]+\\)"
@@ -147,8 +147,8 @@
147147
(when line
148148
(let ((match
149149
(haskell-align-imports-merge-parts
150-
(loop for i from 1 to 8
151-
collect (haskell-align-imports-chomp (match-string i line))))))
150+
(cl-loop for i from 1 to 8
151+
collect (haskell-align-imports-chomp (match-string i line))))))
152152
(setq imports (cons (cons match (line-beginning-position))
153153
imports)))))
154154
(forward-line))
@@ -158,14 +158,14 @@
158158
"Merge together parts of an import statement that shouldn't be separated."
159159
(let ((parts (apply #'vector l))
160160
(join (lambda (ls)
161-
(reduce (lambda (a b)
162-
(concat a
163-
(if (and (> (length a) 0)
164-
(> (length b) 0))
165-
" "
166-
"")
167-
b))
168-
ls))))
161+
(cl-reduce (lambda (a b)
162+
(concat a
163+
(if (and (> (length a) 0)
164+
(> (length b) 0))
165+
" "
166+
"")
167+
b))
168+
ls))))
169169
(if haskell-align-imports-pad-after-name
170170
(list (funcall join (list (aref parts 0)
171171
(aref parts 1)
@@ -195,19 +195,19 @@
195195
"Find the padding for each part of the import statements."
196196
(if (null imports)
197197
imports
198-
(reduce (lambda (a b) (mapcar* #'max a b))
199-
(mapcar (lambda (x) (mapcar #'length (car x)))
200-
imports))))
198+
(cl-reduce (lambda (a b) (cl-mapcar #'max a b))
199+
(mapcar (lambda (x) (mapcar #'length (car x)))
200+
imports))))
201201

202202
(defun haskell-align-imports-fill (padding line)
203203
"Fill an import line using the padding worked out from all statements."
204204
(mapconcat #'identity
205-
(mapcar* (lambda (pad part)
206-
(if (> (length part) 0)
207-
(concat part (make-string (- pad (length part)) ? ))
208-
(make-string pad ? )))
209-
padding
210-
line)
205+
(cl-mapcar (lambda (pad part)
206+
(if (> (length part) 0)
207+
(concat part (make-string (- pad (length part)) ? ))
208+
(make-string pad ? )))
209+
padding
210+
line)
211211
" "))
212212

213213
(defun haskell-align-imports-line-match-it ()

haskell-cabal.el

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
;; (fields (mapcar (lambda (sym) (substring-no-properties sym 0 -1)) syms)))
4949
;; fields))
5050

51-
(with-no-warnings (require 'cl))
51+
(require 'cl-lib)
5252
(require 'haskell-utils)
5353

5454
(defconst haskell-cabal-general-fields
@@ -229,9 +229,9 @@ a list is returned instead of failing with a nil result."
229229
;; http://hackage.haskell.org/packages/archive/Cabal/1.16.0.3/doc/html/Distribution-Simple-Utils.html
230230
;; but without the exception throwing.
231231
(let* ((cabal-files
232-
(remove-if 'file-directory-p
233-
(remove-if-not 'file-exists-p
234-
(directory-files dir t ".\\.cabal\\'")))))
232+
(cl-remove-if 'file-directory-p
233+
(cl-remove-if-not 'file-exists-p
234+
(directory-files dir t ".\\.cabal\\'")))))
235235
(cond
236236
((= (length cabal-files) 1) (car cabal-files)) ;; exactly one candidate found
237237
(allow-multiple cabal-files) ;; pass-thru multiple candidates
@@ -323,12 +323,12 @@ OTHER-WINDOW use `find-file-other-window'."
323323

324324
(defun haskell-cabal-header-p ()
325325
"Is the current line a section or subsection header?"
326-
(case (haskell-cabal-classify-line)
326+
(cl-case (haskell-cabal-classify-line)
327327
((section-header subsection-header) t)))
328328

329329
(defun haskell-cabal-section-header-p ()
330330
"Is the current line a section or subsection header?"
331-
(case (haskell-cabal-classify-line)
331+
(cl-case (haskell-cabal-classify-line)
332332
((section-header) t)))
333333

334334

@@ -551,7 +551,7 @@ resultung buffer-content"
551551

552552
(defun haskell-cabal-listify ()
553553
"Add commas so that buffer contains a comma-seperated list"
554-
(case haskell-cabal-list-comma-position
554+
(cl-case haskell-cabal-list-comma-position
555555
('before
556556
(goto-char (point-min))
557557
(while (haskell-cabal-ignore-line-p) (forward-line))
@@ -842,7 +842,7 @@ Source names from main-is and c-sources sections are left untouched
842842
(defun haskell-cabal-line-entry-column ()
843843
"Column at which the line entry starts"
844844
(save-excursion
845-
(case (haskell-cabal-classify-line)
845+
(cl-case (haskell-cabal-classify-line)
846846
(section-data (beginning-of-line)
847847
(when (looking-at "[ ]*\\(?:,[ ]*\\)?")
848848
(goto-char (match-end 0))
@@ -860,7 +860,7 @@ Source names from main-is and c-sources sections are left untouched
860860
(defun haskell-cabal-indent-line ()
861861
"Indent current line according to subsection"
862862
(interactive)
863-
(case (haskell-cabal-classify-line)
863+
(cl-case (haskell-cabal-classify-line)
864864
(section-data
865865
(save-excursion
866866
(let ((indent (haskell-cabal-section-data-start-column

haskell-checkers.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
;;; Code:
2727

2828
(require 'compile)
29-
(with-no-warnings (require 'cl))
3029

3130
(defgroup haskell-checkers nil
3231
"Run HLint as inferior of Emacs, parse error messages."

haskell-complete-module.el

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
;;; Code:
1919

20-
(require 'cl)
20+
(require 'cl-lib)
2121

2222
(defcustom haskell-complete-module-preferred
2323
'()
@@ -56,17 +56,17 @@
5656
"{"
5757
(mapconcat #'identity
5858
(let* ((i 0))
59-
(loop for candidate in candidates
60-
while (<= i haskell-complete-module-max-display)
61-
do (incf i)
62-
collect (cond ((> i haskell-complete-module-max-display)
63-
"...")
64-
((= i 1)
65-
(propertize candidate 'face 'ido-first-match-face))
66-
(t candidate))))
59+
(cl-loop for candidate in candidates
60+
while (<= i haskell-complete-module-max-display)
61+
do (cl-incf i)
62+
collect (cond ((> i haskell-complete-module-max-display)
63+
"...")
64+
((= i 1)
65+
(propertize candidate 'face 'ido-first-match-face))
66+
(t candidate))))
6767
" | ")
6868
"}"))))
69-
(case key
69+
(cl-case key
7070
(7 (keyboard-quit))
7171
(backspace
7272
(unless (null stack)
@@ -87,9 +87,9 @@
8787
(defun haskell-complete-module (pattern candidates)
8888
"Filter the CANDIDATES using PATTERN."
8989
(let ((case-fold-search t))
90-
(loop for candidate in candidates
91-
when (haskell-complete-module-match pattern candidate)
92-
collect candidate)))
90+
(cl-loop for candidate in candidates
91+
when (haskell-complete-module-match pattern candidate)
92+
collect candidate)))
9393

9494
(defun haskell-complete-module-match (pattern text)
9595
"Match PATTERN against TEXT."

haskell-debug.el

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
;;; Code:
1919

20-
(require 'cl)
21-
20+
(require 'cl-lib)
2221
(require 'haskell-session)
2322
(require 'haskell-process)
2423
(require 'haskell-interactive-mode)
@@ -148,13 +147,13 @@
148147
(when (y-or-n-p "Computation completed without breaking. Reload the module and retry?")
149148
(message "Reloading and resetting breakpoints...")
150149
(haskell-interactive-mode-reset-error (haskell-session))
151-
(loop for break in breakpoints
152-
do (haskell-process-file-loadish
153-
(concat "load " (plist-get break :path))
154-
nil
155-
nil))
156-
(loop for break in breakpoints
157-
do (haskell-debug-break break))
150+
(cl-loop for break in breakpoints
151+
do (haskell-process-file-loadish
152+
(concat "load " (plist-get break :path))
153+
nil
154+
nil))
155+
(cl-loop for break in breakpoints
156+
do (haskell-debug-break break))
158157
(haskell-debug/step expr)))))))))
159158
(haskell-debug/refresh)))
160159

@@ -233,9 +232,9 @@ some old history, then display that."
233232
(plist-get bindings :path)
234233
(plist-get bindings :span)))
235234
(insert "\n\n")
236-
(loop for binding in (plist-get bindings :types)
237-
do (insert (haskell-fontify-as-mode binding 'haskell-mode)
238-
"\n"))))
235+
(cl-loop for binding in (plist-get bindings :types)
236+
do (insert (haskell-fontify-as-mode binding 'haskell-mode)
237+
"\n"))))
239238
(let ((history (or history
240239
(list (haskell-debug-make-fake-history context)))))
241240
(when history
@@ -245,20 +244,20 @@ some old history, then display that."
245244
(defun haskell-debug-insert-history (history)
246245
"Insert tracing HISTORY."
247246
(let ((i (length history)))
248-
(loop for span in history
249-
do (let ((string (haskell-debug-get-span-string
250-
(plist-get span :path)
251-
(plist-get span :span)))
252-
(index (plist-get span :index)))
253-
(insert (propertize (format "%4d" i)
254-
'face 'haskell-debug-trace-number-face)
255-
" "
256-
(haskell-debug-preview-span
257-
(plist-get span :span)
258-
string
259-
t)
260-
"\n")
261-
(setq i (1- i))))))
247+
(cl-loop for span in history
248+
do (let ((string (haskell-debug-get-span-string
249+
(plist-get span :path)
250+
(plist-get span :span)))
251+
(index (plist-get span :index)))
252+
(insert (propertize (format "%4d" i)
253+
'face 'haskell-debug-trace-number-face)
254+
" "
255+
(haskell-debug-preview-span
256+
(plist-get span :span)
257+
string
258+
t)
259+
"\n")
260+
(setq i (1- i))))))
262261

263262
(defun haskell-debug-make-fake-history (context)
264263
"Make a fake history item."
@@ -442,14 +441,14 @@ some old history, then display that."
442441
(haskell-debug-insert-header "Modules")
443442
(if (null modules)
444443
(haskell-debug-insert-muted "No loaded modules.")
445-
(progn (loop for module in modules
446-
do (insert (propertize (plist-get module :module)
447-
'module module
448-
'face `((:weight bold)))
449-
(haskell-debug-muted " - ")
450-
(propertize (file-name-nondirectory (plist-get module :path))
451-
'module module))
452-
do (insert "\n")))))
444+
(progn (cl-loop for module in modules
445+
do (insert (propertize (plist-get module :module)
446+
'module module
447+
'face `((:weight bold)))
448+
(haskell-debug-muted " - ")
449+
(propertize (file-name-nondirectory (plist-get module :path))
450+
'module module))
451+
do (insert "\n")))))
453452

454453
(defun haskell-debug-insert-header (title)
455454
"Insert a header title."
@@ -462,20 +461,20 @@ some old history, then display that."
462461
(haskell-debug-insert-header "Breakpoints")
463462
(if (null breakpoints)
464463
(haskell-debug-insert-muted "No active breakpoints.")
465-
(loop for break in breakpoints
466-
do (insert (propertize (format "%d"
467-
(plist-get break :number))
468-
'face `((:weight bold))
469-
'break break)
470-
(haskell-debug-muted " - ")
471-
(propertize (plist-get break :module)
472-
'break break
473-
'break break)
474-
(haskell-debug-muted
475-
(format " (%d:%d)"
476-
(plist-get (plist-get break :span) :start-line)
477-
(plist-get (plist-get break :span) :start-col)))
478-
"\n")))
464+
(cl-loop for break in breakpoints
465+
do (insert (propertize (format "%d"
466+
(plist-get break :number))
467+
'face `((:weight bold))
468+
'break break)
469+
(haskell-debug-muted " - ")
470+
(propertize (plist-get break :module)
471+
'break break
472+
'break break)
473+
(haskell-debug-muted
474+
(format " (%d:%d)"
475+
(plist-get (plist-get break :span) :start-line)
476+
(plist-get (plist-get break :span) :start-col)))
477+
"\n")))
479478
(insert "\n"))
480479

481480
(defun haskell-debug-insert-muted (text)
@@ -569,9 +568,9 @@ some old history, then display that."
569568
(if (string= string "Empty history. Perhaps you forgot to use :trace?\n")
570569
nil
571570
(let ((entries (mapcar #'haskell-debug-parse-history-entry
572-
(remove-if (lambda (line) (or (string= "<end of history>" line)
573-
(string= "..." line)))
574-
(haskell-debug-split-string string)))))
571+
(cl-remove-if (lambda (line) (or (string= "<end of history>" line)
572+
(string= "..." line)))
573+
(haskell-debug-split-string string)))))
575574
(set (make-local-variable 'haskell-debug-history-cache)
576575
entries)
577576
entries)))))

haskell-decl-scan.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@
100100

101101
;;; Code:
102102

103+
(require 'cl-lib)
103104
(require 'haskell-mode)
104105
(require 'syntax)
105-
(with-no-warnings (require 'cl))
106106
(require 'imenu)
107107

108108
(defgroup haskell-decl-scan nil
@@ -195,7 +195,7 @@ current line that starts with REGEXP and is not in `font-lock-comment-face'."
195195
"Like haskell-ds-move-to-start-regexp, but uses syntax-ppss to
196196
skip comments"
197197
(let (p)
198-
(loop
198+
(cl-loop
199199
do (setq p (point))
200200
(haskell-ds-move-to-start-regexp inc regexp)
201201
while (and (nth 4 (syntax-ppss))

haskell-doc.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@
345345
(require 'haskell-mode)
346346
(require 'inf-haskell)
347347
(require 'imenu)
348-
(with-no-warnings (require 'cl))
349348

350349
(defgroup haskell-doc nil
351350
"Show Haskell function types in echo area."

0 commit comments

Comments
 (0)