summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-01-25 16:36:10 +0000
committerjao <jao@gnu.org>2022-01-25 16:36:55 +0000
commitb2cc3bb6d6245cabaff922168785214ad7fa4b4a (patch)
tree5677a235c4f3a4061dd948a5a7564c55a5edf015
parent4536dcaf53a6a090dd3d8afe95e007ab0410dc2f (diff)
downloadelibs-b2cc3bb6d6245cabaff922168785214ad7fa4b4a.tar.gz
elibs-b2cc3bb6d6245cabaff922168785214ad7fa4b4a.tar.bz2
jao-minibuffer: strip previous data in all message lines
-rw-r--r--lib/eos/jao-minibuffer.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el
index 1671724..5fdb18b 100644
--- a/lib/eos/jao-minibuffer.el
+++ b/lib/eos/jao-minibuffer.el
@@ -71,18 +71,17 @@
(insert msg)
(when hack (other-window 1) (other-window -1)))))
-(defun jao-minibuffer--strip-previous (msg)
+(defun jao-minibuffer--strip-prev (msg)
(if-let* ((l (length msg))
(n (text-property-any 0 l :minibuffer-message t msg)))
(string-trim (substring msg 0 n))
msg))
(defun jao-minibuffer--format-msg (msg)
- (let* ((msgs (split-string msg "\n"))
+ (let* ((msgs (mapcar #'jao-minibuffer--strip-prev (split-string msg "\n")))
(prefix (when-let (p (string-join (butlast msgs) "\n"))
(unless (string-blank-p p) (concat p "\n"))))
(msg (car (last msgs)))
- (msg (jao-minibuffer--strip-previous msg))
(msg (if (string-blank-p msg) msg (concat msg " "))))
(if jao-minibuffer-align-right-p
(concat prefix msg (jao-minibuffer--aligned (length msg)))