Skip to content

Commit a1f031b

Browse files
committed
Merge pull request #508 from gracjan/pr-clean-up-haskell-string
Clean up haskell-string.el utiliy module.
2 parents 8fd06c8 + 719031c commit a1f031b

10 files changed

+287
-305
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ ELFILES = \
4949
haskell-show.el \
5050
haskell-simple-indent.el \
5151
haskell-sort-imports.el \
52-
haskell-str.el \
5352
haskell-string.el \
5453
haskell-unicode-input-method.el \
5554
haskell-utils.el \

haskell-indent.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,8 @@ Returns the location of the start of the comment, nil otherwise."
658658
(string-match "where[ \t]*" haskell-indent-current-line-first-ident))
659659
(diff-first ; not a function def with the same name
660660
(or (null valname-string)
661-
(not (string= (haskell-trim valname-string)
662-
(haskell-trim haskell-indent-current-line-first-ident)))))
661+
(not (string= (haskell-string-trim valname-string)
662+
(haskell-string-trim haskell-indent-current-line-first-ident)))))
663663

664664
;; (is-type-def
665665
;; (and rhs-sign (eq (char-after rhs-sign) ?\:)))

haskell-interactive-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ SESSION, otherwise operate on the current buffer.
416416
(message "%s"
417417
(concat (car lines)
418418
(if (and (cdr lines) (stringp (cadr lines)))
419-
(format " [ %s .. ]" (haskell-string-take (haskell-trim (cadr lines)) 10))
419+
(format " [ %s .. ]" (haskell-string-take (haskell-string-trim (cadr lines)) 10))
420420
""))))))
421421

422422
(defun haskell-interactive-mode-tab ()

haskell-process.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
(require 'haskell-compat)
3030
(require 'haskell-session)
3131
(require 'haskell-customize)
32-
(require 'haskell-str)
32+
(require 'haskell-string)
3333

3434
(defconst haskell-process-prompt-regex "\4"
3535
"Used for delimiting command replies. 4 is End of Transmission.")
@@ -264,17 +264,17 @@ This uses `accept-process-output' internally."
264264
(defun haskell-process-get-repl-completions (process inputstr)
265265
"Perform `:complete repl ...' query for INPUTSTR using PROCESS."
266266
(let* ((reqstr (concat ":complete repl "
267-
(haskell-str-literal-encode inputstr)))
267+
(haskell-string-literal-encode inputstr)))
268268
(rawstr (haskell-process-queue-sync-request process reqstr)))
269269
(if (string-prefix-p "unknown command " rawstr)
270270
(error "GHCi lacks `:complete' support")
271271
(let* ((s1 (split-string rawstr "\r?\n" t))
272-
(cs (mapcar #'haskell-str-literal-decode (cdr s1)))
272+
(cs (mapcar #'haskell-string-literal-decode (cdr s1)))
273273
(h0 (car s1))) ;; "<cnt1> <cnt2> <quoted-str>"
274274
(unless (string-match "\\`\\([0-9]+\\) \\([0-9]+\\) \\(\".*\"\\)\\'" h0)
275275
(error "Invalid `:complete' response"))
276276
(let ((cnt1 (match-string 1 h0))
277-
(h1 (haskell-str-literal-decode (match-string 3 h0))))
277+
(h1 (haskell-string-literal-decode (match-string 3 h0))))
278278
(unless (= (string-to-number cnt1) (length cs))
279279
(error "Lengths inconsistent in `:complete' reponse"))
280280
(cons h1 cs))))))

haskell-show.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
(defun haskell-show-parse-and-insert (given)
5252
"Parse a `string' containing a Show instance value and insert
5353
it pretty printed into the current buffer."
54-
(when (not (string= "" (haskell-trim given)))
54+
(when (not (string= "" (haskell-string-trim given)))
5555
(let ((current-column (- (point)
5656
(line-beginning-position)))
5757
(result (haskell-show-parse given)))

haskell-str.el

Lines changed: 0 additions & 167 deletions
This file was deleted.

0 commit comments

Comments
 (0)