@vindex winner-dont-bind-my-keys
@vindex winner-ring-size
@vindex winner-boring-buffers
+@vindex winner-boring-buffers-regexp
@cindex Winner mode
@cindex mode, Winner
@cindex undoing window configuration changes
window configurations per frame, but you can change that by modifying
the variable @code{winner-ring-size}. If there are some buffers whose
windows you wouldn't want Winner mode to restore, add their names to
-the list variable @code{winner-boring-buffers}.
+the list variable @code{winner-boring-buffers} or to the regexp
+@code{winner-boring-buffers-regexp}.
Follow mode (@kbd{M-x follow-mode}) synchronizes several windows on
the same buffer so that they always display adjacent sections of that
(defcustom winner-dont-bind-my-keys nil
"Non-nil means do not bind keys in Winner mode."
- :type 'boolean
- :group 'winner)
+ :type 'boolean)
(defcustom winner-ring-size 200
"Maximum number of stored window configurations per frame."
- :type 'integer
- :group 'winner)
+ :type 'integer)
(defcustom winner-boring-buffers '("*Completions*")
"List of buffer names whose windows `winner-undo' will not restore.
You may want to include buffer names such as *Help*, *Apropos*,
*Buffer List*, *info* and *Compile-Log*."
- :type '(repeat string)
- :group 'winner)
+ :type '(repeat string))
+(defcustom winner-boring-buffers-regexp nil
+ "`winner-undo' will not restore windows with buffers matching this regexp."
+ :type 'string
+ :version "27.1")
\f
;;;; Saving old configurations (internal variables and subroutines)
\f
;; Make sure point does not end up in the minibuffer and delete
;; windows displaying dead or boring buffers
-;; (c.f. `winner-boring-buffers'). Return nil if all the windows
-;; should be deleted. Preserve correct points and marks.
+;; (c.f. `winner-boring-buffers') and `winner-boring-buffers-regexp'.
+;; Return nil if all the windows should be deleted. Preserve correct
+;; points and marks.
(defun winner-set (conf)
;; For the format of `conf', see `winner-conf'.
(let* ((buffers nil)
(not (= marker pos)))
(setq pos marker))
(setf (window-point win) pos)))
- (not (member (buffer-name (window-buffer win))
- winner-boring-buffers)))
+ (not (or (member (buffer-name (window-buffer win))
+ winner-boring-buffers)
+ (and winner-boring-buffers-regexp
+ (string-match
+ winner-boring-buffers-regexp
+ (buffer-name (window-buffer win)))))))
(push win xwins))) ; delete this window
;; Restore marks
;; Return t if this is still a possible configuration.
(or (null xwins)
(progn
- (mapc 'delete-window (cdr xwins)) ; delete all but one
- (unless (one-window-p t)
- (delete-window (car xwins))
- t))))))
+ (mapc 'delete-window (cdr xwins)) ; delete all but one
+ (unless (one-window-p t)
+ (delete-window (car xwins))
+ t))))))