[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure 85d3d41 014/313: Extract a chomp helper
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure 85d3d41 014/313: Extract a chomp helper |
Date: |
Wed, 11 Aug 2021 09:59:37 -0400 (EDT) |
branch: elpa/inf-clojure
commit 85d3d41fecb9c288f72e88674dae573bc4fd9a66
Author: Bozhidar Batsov <bozhidar@tradeo.com>
Commit: Bozhidar Batsov <bozhidar@tradeo.com>
Extract a chomp helper
---
inf-clojure.el | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/inf-clojure.el b/inf-clojure.el
index 3a0f3c1..a6e5841 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -233,16 +233,18 @@ to continue it."
"t if STR does not match `inf-clojure-filter-regexp'."
(not (string-match inf-clojure-filter-regexp str)))
+(defun inf-clojure-chomp (string)
+ (if (string-match "[\n]\\'" string)
+ (replace-match "" t t string)
+ string))
+
(defun clojure-preoutput-filter (str)
"Preprocess the output STR from interactive commands."
- (if (string-prefix-p "clojure-" (symbol-name (or this-command last-command)))
- ;; prepend a newline to the output string
- (let ((string (concat "\n" str)))
- ;; strip the extra trailing newline
- (if (string-match "[\n]+\\'" string)
- (replace-match "" t t string)
- string))
- str))
+ (cond
+ ((string-prefix-p "clojure-" (symbol-name (or this-command last-command)))
+ ;; prepend a newline to the output string
+ (inf-clojure-chomp (concat "\n" str)))
+ (t str)))
;;;###autoload
(defun inf-clojure (cmd)
- [nongnu] elpa/inf-clojure 7b377a4 013/313: Drop redundant function, (continued)
- [nongnu] elpa/inf-clojure 7b377a4 013/313: Drop redundant function, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f65ce48 021/313: Enable completion in inf-clojure-minor-mode, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 7b9e0d1 029/313: Code style, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ef8c830 030/313: Use #' where appropriate, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure b897bb8 031/313: Show arglist in the minibuffer for better usability, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 89035ee 033/313: Merge pull request #9 from mavbozo/ms-windows-hang, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure dd2b4fc 038/313: Code style, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 898a319 041/313: Improve the README a bit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ff20773 044/313: Release 1.2.0, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0652692 012/313: Preprocess the output from interactive commands, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 85d3d41 014/313: Extract a chomp helper,
ELPA Syncer <=
- [nongnu] elpa/inf-clojure abb5a53 017/313: Add macroexpand command, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 3c2a1ed 022/313: Rename switch-to-clojure to inf-clojure-switch-to-repl, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f00b2b5 026/313: Add a menu for inf-clojure-minor-mode, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0d5f715 027/313: Unify the style of the REPL and minor mode menus, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 9a0323d 028/313: [Fix #4] Start subprocess in the root of lein and boot projects, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure b2d6d0e 009/313: Add a command to show a var's source, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 52f9404 016/313: Add apropos command, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ecf614e 018/313: Use inf-clojure prefix consistently, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2627825 025/313: Move inf-clojure-mode menu definition, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure de88e4f 032/313: Solution to unresponsive repl in Windows OS, ELPA Syncer, 2021/08/11