[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/buffer-expose ad46865 3/9: Allow selecting empty buffer
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/buffer-expose ad46865 3/9: Allow selecting empty buffers |
Date: |
Tue, 26 Feb 2019 16:11:55 -0500 (EST) |
branch: externals/buffer-expose
commit ad468651ef86cca894030b17a31149e3c7d1d5b5
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Allow selecting empty buffers
---
buffer-expose.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/buffer-expose.el b/buffer-expose.el
index dcced8c..81fcef9 100644
--- a/buffer-expose.el
+++ b/buffer-expose.el
@@ -420,12 +420,15 @@ Return list of windows created."
(balance-windows)
(nreverse ws)))
+(defvar-local buffer-expose--empty-buffer nil)
+
(defun buffer-expose--create-empty-buffer (&optional name)
"Create buffer for empty window with name NAME.
NAME defaults to `buffer-expose--empty-buffer-name'."
(with-current-buffer (generate-new-buffer
(or name buffer-expose--empty-buffer-name))
+ (setq-local buffer-expose--empty-buffer t)
(setq buffer-read-only t)
(setq mode-line-format "")
(setq cursor-type nil)
@@ -434,9 +437,7 @@ NAME defaults to `buffer-expose--empty-buffer-name'."
(defun buffer-expose-fill-grid ()
"Fill grid windows."
- (let ((ws buffer-expose--window-list)
- (emptybuffer (or (get-buffer buffer-expose--empty-buffer-name)
- (buffer-expose--create-empty-buffer))))
+ (let ((ws buffer-expose--window-list))
(dolist (w ws)
(if buffer-expose--buffer-list
(with-current-buffer (pop buffer-expose--buffer-list)
@@ -473,24 +474,23 @@ NAME defaults to `buffer-expose--empty-buffer-name'."
(setq header-line-format nil))
(setf (window-buffer w) (current-buffer)))
- (setf (window-buffer w) emptybuffer)))))
+ (setf (window-buffer w)
+ (buffer-expose--create-empty-buffer))))))
(defun buffer-expose--empty-window-p (w)
"Check if window W is an empty one."
- (eq (window-buffer w)
- (get-buffer buffer-expose--empty-buffer-name)))
+ (with-current-buffer (window-buffer w)
+ buffer-expose--empty-buffer))
(defun buffer-expose--select-window (w)
"Select window W.
Prevents switching to empty windows. Does not change the order of
`buffer-list'. After selection the grid view is updated."
- (if (buffer-expose--empty-window-p w)
- (message "Can not switch to empty window.")
- ;; dont put buffer at front when selecting windows
- (select-window w :no-record)
- ;; redisplay
- (buffer-expose--update-display)))
+ ;; dont put buffer at front when selecting windows
+ (select-window w :no-record)
+ ;; redisplay
+ (buffer-expose--update-display))
(defun buffer-expose-show-buffers (blist &optional max regexes filter)
- [elpa] externals/buffer-expose updated (713238b -> 1a77e7f), Clemens Radermacher, 2019/02/26
- [elpa] externals/buffer-expose 6efa786 2/9: Fixes group description #4, Clemens Radermacher, 2019/02/26
- [elpa] externals/buffer-expose ee6bcfe 4/9: Add kill buffer command, Clemens Radermacher, 2019/02/26
- [elpa] externals/buffer-expose ad46865 3/9: Allow selecting empty buffers,
Clemens Radermacher <=
- [elpa] externals/buffer-expose 04b696e 7/9: Rename reset functions to internal functions, Clemens Radermacher, 2019/02/26
- [elpa] externals/buffer-expose 1a77e7f 9/9: Version bump, Clemens Radermacher, 2019/02/26
- [elpa] externals/buffer-expose 6159833 8/9: Update help message, Clemens Radermacher, 2019/02/26
- [elpa] externals/buffer-expose e48ee91 6/9: Cleanup empty buffers on exit, Clemens Radermacher, 2019/02/26
- [elpa] externals/buffer-expose 5dd61e4 1/9: Add GNU ELPA badge, Clemens Radermacher, 2019/02/26
- [elpa] externals/buffer-expose ba3e539 5/9: Move current window if buffer not killed, Clemens Radermacher, 2019/02/26