[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 3c4b3fd 16/28: lv.el: Update truncation rules
From: |
Oleh Krehel |
Subject: |
[elpa] master 3c4b3fd 16/28: lv.el: Update truncation rules |
Date: |
Sun, 22 Mar 2015 16:34:44 +0000 |
branch: master
commit 3c4b3fd8609af2b114536e25cc15e2078b8d2441
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
lv.el: Update truncation rules
* lv.el (lv-window): Defer `truncate-lines' to `lv-message'. Set window
hscroll to 0, just in case.
(lv-message): If STR is one-line, set `truncate-lines' to nil, otherwise
set it to t. Make `window-min-height' buffer-local and set it to the
amount of newlines in STR.
Re #40.
---
lv.el | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lv.el b/lv.el
index bb47175..969f5cb 100644
--- a/lv.el
+++ b/lv.el
@@ -49,7 +49,7 @@
(if (setq buf (get-buffer "*LV*"))
(switch-to-buffer buf)
(switch-to-buffer "*LV*")
- (setq truncate-lines nil)
+ (set-window-hscroll lv-wnd 0)
(setq mode-line-format nil)
(setq cursor-type nil)
(set-window-dedicated-p lv-wnd t)
@@ -58,14 +58,18 @@
(defun lv-message (format-string &rest args)
"Set LV window contents to (`format' FORMAT-STRING ARGS)."
- (let ((ori (selected-window))
- (str (apply #'format format-string args))
- deactivate-mark
- golden-ratio-mode)
+ (let* ((ori (selected-window))
+ (str (apply #'format format-string args))
+ (n-lines (cl-count ?\n str))
+ deactivate-mark
+ golden-ratio-mode)
(select-window (lv-window))
(unless (string= (buffer-string) str)
(delete-region (point-min) (point-max))
(insert str)
+ (set (make-variable-buffer-local 'window-min-height)
+ n-lines)
+ (setq truncate-lines (> n-lines 1))
(fit-window-to-buffer nil nil 1))
(goto-char (point-min))
(select-window ori)))
- [elpa] master b840227 03/28: Update `golden-ratio-mode' work-around, (continued)
- [elpa] master b840227 03/28: Update `golden-ratio-mode' work-around, Oleh Krehel, 2015/03/22
- [elpa] master 77c8e40 01/28: Add option to specify :hint in body, Oleh Krehel, 2015/03/22
- [elpa] master 88c7dc4 04/28: Fix wrong type argument in hydra-timeout, Oleh Krehel, 2015/03/22
- [elpa] master 5c2f420 06/28: hydra-examples.el: Fixup, Oleh Krehel, 2015/03/22
- [elpa] master 58075f5 08/28: hydra-examples.el (hydra-buffer-menu): Fix example, Oleh Krehel, 2015/03/22
- [elpa] master bca2441 07/28: Makefile: Simplify, Oleh Krehel, 2015/03/22
- [elpa] master a867927 05/28: "C-g" (`hydra-keyboard-quit' ) should run :post, Oleh Krehel, 2015/03/22
- [elpa] master 7f4c835 11/28: README.md: finish up the rules, Oleh Krehel, 2015/03/22
- [elpa] master 556db52 14/28: Wiki link to the "Home" page instead., Oleh Krehel, 2015/03/22
- [elpa] master c9432e8 12/28: README.md: describe docstring, Oleh Krehel, 2015/03/22
- [elpa] master 3c4b3fd 16/28: lv.el: Update truncation rules,
Oleh Krehel <=
- [elpa] master 3f11348 13/28: README.md: Add toc, Oleh Krehel, 2015/03/22
- [elpa] master 5e8c7f2 18/28: hydra.el (hydra--format): Extend key regex with "; :", Oleh Krehel, 2015/03/22
- [elpa] master 3a77bf6 20/28: hydra-examples.el (hydra-apropos): Add., Oleh Krehel, 2015/03/22
- [elpa] master 622c798 10/28: README.md: move some stuff to wiki, add more stuff, Oleh Krehel, 2015/03/22
- [elpa] master 9f9dcf9 17/28: Bind [switch-frame] to `hydra-keyboard-quit', Oleh Krehel, 2015/03/22
- [elpa] master 543e97b 19/28: Fix switch-frame handling., Oleh Krehel, 2015/03/22
- [elpa] master 97d6987 21/28: Add hydra-rectangle example, Oleh Krehel, 2015/03/22
- [elpa] master bfe65da 15/28: README.md: Fix up typos, Oleh Krehel, 2015/03/22
- [elpa] master d44bf58 22/28: Don't bind `hydra-keyboard-quit' in foreign keymaps, Oleh Krehel, 2015/03/22
- [elpa] master eb181fd 23/28: Call :post for :timeout, Oleh Krehel, 2015/03/22