diff options
author | Craig Earls <enderw88@gmail.com> | 2014-11-27 09:42:23 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-11-27 09:42:23 -0700 |
commit | 54a736feabfa3993ffc38433e3c12b611391f952 (patch) | |
tree | 045f4fe86f025e1ef262a9fddbb129c780a26ea3 | |
parent | db7e4fd741021bec72121f915414679d30144735 (diff) | |
download | fork-ledger-54a736feabfa3993ffc38433e3c12b611391f952.tar.gz fork-ledger-54a736feabfa3993ffc38433e3c12b611391f952.tar.bz2 fork-ledger-54a736feabfa3993ffc38433e3c12b611391f952.zip |
Remove s-trim functions since they stomp on s.el.
-rw-r--r-- | lisp/ledger-fontify.el | 20 | ||||
-rw-r--r-- | lisp/ledger-state.el | 6 |
2 files changed, 5 insertions, 21 deletions
diff --git a/lisp/ledger-fontify.el b/lisp/ledger-fontify.el index 309cbc3b..caf7690a 100644 --- a/lisp/ledger-fontify.el +++ b/lisp/ledger-fontify.el @@ -82,7 +82,7 @@ Fontify the first line of an xact" (let ((state nil)) (re-search-forward ledger-xact-start-regex) (ledger-fontify-set-face (list (match-beginning 1) (match-end 1)) 'ledger-font-posting-date-face) - (save-match-data (setq state (ledger-state-from-string (s-trim (match-string 5))))) + (save-match-data (setq state (ledger-state-from-string (match-string 5)))) (ledger-fontify-set-face (list (match-beginning 7) (match-end 7)) (cond ((eq state 'pending) 'ledger-font-payee-pending-face) @@ -113,7 +113,7 @@ Fontify the first line of an xact" ;; that took to figure out (re-search-forward " \\([*!]\\) " end t) (if (match-string 1) - (setq state (ledger-state-from-string (s-trim (match-string 1)))))) + (setq state (ledger-state-from-string (match-string 1))))) (beginning-of-line) (re-search-forward "[[:graph:]]\\([ \t][ \t]\\)" end 'end) ;; find the end of the account, or end of line @@ -191,20 +191,4 @@ Fontify the first line of an xact" (defun ledger-fontify-set-face (extents face) (put-text-property (car extents) (cadr extents) 'face face)) - -(defun s-trim-left (s) - "Remove whitespace at the beginning of S." - (if (string-match "\\`[ \t\n\r]+" s) - (replace-match "" t t s) - s)) - -(defun s-trim-right (s) - "Remove whitespace at the end of S." - (if (string-match "[ \t\n\r]+\\'" s) - (replace-match "" t t s) - s)) - -(defun s-trim (s) - "Remove whitespace at the beginning and end of S." - (s-trim-left (s-trim-right s))) ;;; ledger-fontify.el ends here diff --git a/lisp/ledger-state.el b/lisp/ledger-state.el index 8822570d..b2574b10 100644 --- a/lisp/ledger-state.el +++ b/lisp/ledger-state.el @@ -68,9 +68,9 @@ (defun ledger-state-from-string (state-string) "Get state from STATE-CHAR." - (cond ((string= state-string "!") 'pending) - ((string= state-string "*") 'cleared) - ((string= state-string ";") 'comment) + (cond ((string-match "\\!" state-string) 'pending) + ((string-match "\\*" state-string) 'cleared) + ((string-match ";" state-string) 'comment) (t nil))) (defun ledger-toggle-current-posting (&optional style) |