Skip to content

Get rid of purescript-string module #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ ELFILES = \
purescript-simple-indent.el \
purescript-sort-imports.el \
purescript-str.el \
purescript-string.el \
purescript-unicode-input-method.el \
purescript-utils.el \
purescript-decl-scan.el \
Expand Down
8 changes: 5 additions & 3 deletions purescript-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@
;;; Code:

(require 'purescript-vars)
(require 'purescript-string)
(require 'cl-lib)
(eval-when-compile
(when (< emacs-major-version 28)
(require 'subr-x)))

(defgroup purescript-indent nil
"PureScript indentation."
Expand Down Expand Up @@ -655,8 +657,8 @@ symbols in the sexp."
(string-match "where[ \t]*" purescript-indent-current-line-first-ident))
(diff-first ; not a function def with the same name
(or (null valname-string)
(not (string= (purescript-trim valname-string)
(purescript-trim purescript-indent-current-line-first-ident)))))
(not (string= (string-trim valname-string)
(string-trim purescript-indent-current-line-first-ident)))))

;; (is-type-def
;; (and rpurs-sign (eq (char-after rpurs-sign) ?\:)))
Expand Down
9 changes: 7 additions & 2 deletions purescript-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
(require 'purescript-vars)
(require 'purescript-align-imports)
(require 'purescript-sort-imports)
(require 'purescript-string)
(require 'purescript-font-lock)
(require 'cl-lib)
(cl-eval-when 'compile (require 'find-file))
Expand Down Expand Up @@ -432,14 +431,20 @@ Brings up the documentation for purescript-mode-hook."
(goto-char (+ (line-beginning-position)
col))))

(defun purescript-string-take (string n)
"Take n chars from string."
(substring string
0
(min (length string) n)))

(defun purescript-mode-message-line (str)
"Message only one line, multiple lines just disturbs the programmer."
(let ((lines (split-string str "\n" t)))
(when (and (car lines) (stringp (car lines)))
(message "%s"
(concat (car lines)
(if (and (cdr lines) (stringp (cadr lines)))
(format " [ %s .. ]" (purescript-string-take (purescript-trim (cadr lines)) 10))
(format " [ %s .. ]" (purescript-string-take (string-trim (cadr lines)) 10))
""))))))

(defun purescript-current-line-string ()
Expand Down
24 changes: 0 additions & 24 deletions purescript-string.el

This file was deleted.