emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/golden-ratio ff8ade7d35 19/95: Merge branch 'release/with-


From: ELPA Syncer
Subject: [nongnu] elpa/golden-ratio ff8ade7d35 19/95: Merge branch 'release/with-exemption-support'
Date: Thu, 7 Sep 2023 22:02:10 -0400 (EDT)

branch: elpa/golden-ratio
commit ff8ade7d359bfc6888942533515bed2c5d327f34
Merge: f5b3602b5d 650121be18
Author: Stuart Hickinbottom <stuart@hickinbottom.com>
Commit: Stuart Hickinbottom <stuart@hickinbottom.com>

    Merge branch 'release/with-exemption-support'
---
 golden-ratio.el | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/golden-ratio.el b/golden-ratio.el
index d012f976b7..afcffaab8d 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -20,6 +20,26 @@
 (defconst -golden-ratio-value 1.618
   "The golden ratio value itself.")
 
+;; Major modes that are exempt from being resized. An example of this
+;; for users of Org-mode might be:
+;;  ("calendar-mode")
+(defcustom golden-ratio-exclude-modes nil
+  "An array of strings naming major modes. Switching to a buffer
+whose major mode is a member of this list will not cause the
+window to be resized to the golden ratio."
+  :type '(repeat string)
+  :group 'golden-ratio)
+
+;; Buffer names that are exempt from being resized. An example of this
+;; for users of Org-mode might be (note the leading spaces):
+;;  (" *Org tags*" " *Org todo*")
+(defcustom golden-ratio-exclude-buffer-names nil
+  "An array of strings containing buffer names. Switching to a
+buffer whose name is a member of this list will not cause the
+window to be resized to the golden ratio."
+  :type '(repeat string)
+  :group 'golden-ratio)
+
 (defun -golden-ratio-dimensions ()
   (let* ((main-rows     (floor (/ (frame-height) -golden-ratio-value)))
          (main-columns  (floor (/ (frame-width)  -golden-ratio-value))))
@@ -47,7 +67,11 @@
   "Resizes current window to the golden-ratio's size specs"
   (interactive)
   (if (and (not (window-minibuffer-p))
-           (not (one-window-p)))
+           (not (one-window-p))
+          (not (member (symbol-name major-mode)
+                       golden-ratio-exclude-modes))
+          (not (member (buffer-name)
+                       golden-ratio-exclude-buffer-names)))
       (progn
         (balance-windows)
         (-golden-ratio-resize-window (-golden-ratio-dimensions)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]