branch: elpa/inf-clojure
commit 0cab136f25b83d8d47c6e42faa25b5025a47d6b2
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Simplify inf-clojure-chomp to use string-trim-right
    
    The hand-rolled regex + replace-match reimplements what
    string-trim-right already provides.
---
 inf-clojure.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/inf-clojure.el b/inf-clojure.el
index 8ba8e21390..97c8f6ad48 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -707,9 +707,7 @@ If `comint-use-prompt-regexp' is nil (the default), 
\\[comint-insert-input] on
 
 (defun inf-clojure-chomp (string)
   "Remove final newline from STRING."
-  (if (string-match "[\n]\\'" string)
-      (replace-match "" t t string)
-    string))
+  (string-trim-right string "\n"))
 
 (defun inf-clojure-remove-subprompts (string)
   "Remove subprompts from STRING."

Reply via email to