]> code.delx.au - gnu-emacs-elpa/commitdiff
Optionally separate lv window and echo area using a thin line
authorJonas Bernoulli <jonas@bernoul.li>
Sun, 26 Apr 2015 18:38:46 +0000 (20:38 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Mon, 27 Apr 2015 12:30:24 +0000 (14:30 +0200)
* lv.el (lv-use-separator): New option.
(lv-separator): New face.
(lv): New custom group.
(lv-message): Respect lv-use-separator using lv-separator.

Re #122

lv.el

diff --git a/lv.el b/lv.el
index 76094b58f7209f96f1e217f7bad8a907a7cdc890..c4b7743c9d393a22944ede552f69b33ea457df81 100644 (file)
--- a/lv.el
+++ b/lv.el
 
 ;;; Code:
 
+(defgroup lv nil
+  "The other echo area."
+  :group 'minibuffer
+  :group 'hydra)
+
+(defcustom lv-use-separator nil
+  "Whether to draw a line between the lv window and the echo area."
+  :group 'lv
+  :type 'boolean)
+
+(defface lv-separator
+  '((((class color) (background light)) :background "grey80")
+    (((class color) (background  dark)) :background "grey30"))
+  "Face used to draw line between the lv window and the echo area.
+This is only used if option `lv-use-separator' is non-nil.
+Only the background color is significant."
+  :group 'lv)
+
 (defvar lv-wnd nil
   "Holds the current LV window.")
 
                    (null lv-force-update))
         (delete-region (point-min) (point-max))
         (insert str)
+        (when (window-system)
+          (unless (string-match-p "\n$" str)
+            (insert "\n"))
+          (insert
+           (propertize "__" 'face 'lv-separator 'display '(space :height (1)))
+           (propertize "\n" 'face 'lv-separator 'line-height t)))
         (setq-local window-min-height n-lines)
         (setq truncate-lines (> n-lines 1))
-        (fit-window-to-buffer nil nil 1))
+        (let ((window-resize-pixelwise t))
+          (fit-window-to-buffer nil nil 1)))
       (goto-char (point-min)))))
 
 (defun lv-delete-window ()