Skip to content

Commit

Permalink
Clean up haskell-string.el utiliy module.
Browse files Browse the repository at this point in the history
  • Loading branch information
gracjan committed Mar 13, 2015
1 parent 1766c26 commit 719031c
Show file tree
Hide file tree
Showing 10 changed files with 287 additions and 305 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ ELFILES = \
haskell-show.el \
haskell-simple-indent.el \
haskell-sort-imports.el \
haskell-str.el \
haskell-string.el \
haskell-unicode-input-method.el \
haskell-utils.el \
Expand Down
4 changes: 2 additions & 2 deletions haskell-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,8 @@ Returns the location of the start of the comment, nil otherwise."
(string-match "where[ \t]*" haskell-indent-current-line-first-ident))
(diff-first ; not a function def with the same name
(or (null valname-string)
(not (string= (haskell-trim valname-string)
(haskell-trim haskell-indent-current-line-first-ident)))))
(not (string= (haskell-string-trim valname-string)
(haskell-string-trim haskell-indent-current-line-first-ident)))))

;; (is-type-def
;; (and rhs-sign (eq (char-after rhs-sign) ?\:)))
Expand Down
2 changes: 1 addition & 1 deletion haskell-interactive-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ SESSION, otherwise operate on the current buffer.
(message "%s"
(concat (car lines)
(if (and (cdr lines) (stringp (cadr lines)))
(format " [ %s .. ]" (haskell-string-take (haskell-trim (cadr lines)) 10))
(format " [ %s .. ]" (haskell-string-take (haskell-string-trim (cadr lines)) 10))
""))))))

(defun haskell-interactive-mode-tab ()
Expand Down
8 changes: 4 additions & 4 deletions haskell-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(require 'haskell-compat)
(require 'haskell-session)
(require 'haskell-customize)
(require 'haskell-str)
(require 'haskell-string)

(defconst haskell-process-prompt-regex "\4"
"Used for delimiting command replies. 4 is End of Transmission.")
Expand Down Expand Up @@ -272,17 +272,17 @@ This uses `accept-process-output' internally."
(defun haskell-process-get-repl-completions (process inputstr)
"Perform `:complete repl ...' query for INPUTSTR using PROCESS."
(let* ((reqstr (concat ":complete repl "
(haskell-str-literal-encode inputstr)))
(haskell-string-literal-encode inputstr)))
(rawstr (haskell-process-queue-sync-request process reqstr)))
(if (string-prefix-p "unknown command " rawstr)
(error "GHCi lacks `:complete' support")
(let* ((s1 (split-string rawstr "\r?\n" t))
(cs (mapcar #'haskell-str-literal-decode (cdr s1)))
(cs (mapcar #'haskell-string-literal-decode (cdr s1)))
(h0 (car s1))) ;; "<cnt1> <cnt2> <quoted-str>"
(unless (string-match "\\`\\([0-9]+\\) \\([0-9]+\\) \\(\".*\"\\)\\'" h0)
(error "Invalid `:complete' response"))
(let ((cnt1 (match-string 1 h0))
(h1 (haskell-str-literal-decode (match-string 3 h0))))
(h1 (haskell-string-literal-decode (match-string 3 h0))))
(unless (= (string-to-number cnt1) (length cs))
(error "Lengths inconsistent in `:complete' reponse"))
(cons h1 cs))))))
Expand Down
2 changes: 1 addition & 1 deletion haskell-show.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
(defun haskell-show-parse-and-insert (given)
"Parse a `string' containing a Show instance value and insert
it pretty printed into the current buffer."
(when (not (string= "" (haskell-trim given)))
(when (not (string= "" (haskell-string-trim given)))
(let ((current-column (- (point)
(line-beginning-position)))
(result (haskell-show-parse given)))
Expand Down
167 changes: 0 additions & 167 deletions haskell-str.el

This file was deleted.

Loading

0 comments on commit 719031c

Please sign in to comment.