branch: elpa/golden-ratio
commit 72b028808b41d23fa3f7e8c0d23d2c475e7b46ae
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Allow buffer exclusion with regular expressions (#58).
    
    * golden-ratio.el (golden-ratio-exclude-buffer-regexp): New user var.
    (golden-ratio): Use it.
---
 golden-ratio.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/golden-ratio.el b/golden-ratio.el
index 58190b7f83..b16441a8c4 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -80,6 +80,12 @@ will not cause the window to be resized to the golden ratio."
   :group 'golden-ratio
   :type 'boolean)
 
+(defcustom golden-ratio-exclude-buffer-regexp nil
+  "A list of regexp's used to match buffer names.
+Switching to a buffer whose name matches one of these regexps
+will prevent the window to be resized to the golden ratio."
+  :type '(repeat string)
+  :group 'golden-ratio)
 
 ;;; Compatibility
 ;;
@@ -136,6 +142,9 @@ will not cause the window to be resized to the golden 
ratio."
               (golden-ratio-exclude-major-mode-p)
               (member (buffer-name)
                       golden-ratio-exclude-buffer-names)
+              (and golden-ratio-exclude-buffer-regexp
+                (loop for r in golden-ratio-exclude-buffer-regexp
+                         thereis (string-match r (buffer-name))))
               (and golden-ratio-inhibit-functions
                    (loop for fun in golden-ratio-inhibit-functions
                          thereis (funcall fun))))

Reply via email to