[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/spacious-padding af8030e75e 3/3: Make another attempt t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/spacious-padding af8030e75e 3/3: Make another attempt to set the frame parameters and faces again |
Date: |
Mon, 29 Apr 2024 03:59:18 -0400 (EDT) |
branch: externals/spacious-padding
commit af8030e75e7106e5af6ba481207de6506f23bab2
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make another attempt to set the frame parameters and faces again
This is still related to issue 13:
<https://github.com/protesilaos/spacious-padding/issues/13>.
---
spacious-padding.el | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/spacious-padding.el b/spacious-padding.el
index 8297b486f4..10dd86d14a 100644
--- a/spacious-padding.el
+++ b/spacious-padding.el
@@ -384,7 +384,7 @@ parameter value."
(spacious-padding--define-get-frame-param "right-fringe-width" nil)
(spacious-padding--define-get-frame-param "scroll-bar-width" 8)
-(defun spacious-padding-modify-frame-parameters (reset)
+(defun spacious-padding-modify-frame-parameters (&optional reset)
"Modify all frame parameters to specify spacing.
With optional RESET argument as non-nil, restore the default
parameter values."
@@ -397,20 +397,27 @@ parameter values."
(spacious-padding--get-fringe-width reset)))
(scroll-bar-width . ,(spacious-padding--get-scroll-bar-width reset)))))
+;;;###autoload
+(defun spacious-padding-set-parameters-of-frame (frame)
+ "Set the layout parameters of FRAME and update the faces."
+ (with-selected-frame frame
+ (spacious-padding-modify-frame-parameters)
+ (spacious-padding-set-faces)))
+
(defun spacious-padding--enable-mode ()
"Enable `spacious-padding-mode'."
(spacious-padding--store-default-parameters)
- (spacious-padding-modify-frame-parameters nil)
- (add-hook 'after-make-frame-functions
#'spacious-padding-set-invisible-dividers))
+ (spacious-padding-modify-frame-parameters)
(spacious-padding-set-faces)
(add-hook 'enable-theme-functions #'spacious-padding-set-faces)
+ (add-hook 'after-make-frame-functions
#'spacious-padding-set-parameters-of-frame))
(defun spacious-padding--disable-mode ()
"Disable `spacious-padding-mode'."
(spacious-padding-modify-frame-parameters :reset)
(spacious-padding-unset-invisible-dividers)
- (remove-hook 'after-make-frame-functions
#'spacious-padding-set-invisible-dividers))
(remove-hook 'enable-theme-functions #'spacious-padding-set-faces)
+ (remove-hook 'after-make-frame-functions
#'spacious-padding-set-parameters-of-frame))
;;;###autoload
(define-minor-mode spacious-padding-mode