~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e0cc698
)
el/dot-emacs.el: Abstract out `mdw-frame-with-for-columns' function.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 6 Dec 2023 14:23:02 +0000
(14:23 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 6 Dec 2023 14:23:02 +0000
(14:23 +0000)
el/dot-emacs.el
patch
|
blob
|
blame
|
history
diff --git
a/el/dot-emacs.el
b/el/dot-emacs.el
index
4be3268
..
ed894dd
100644
(file)
--- a/
el/dot-emacs.el
+++ b/
el/dot-emacs.el
@@
-253,6
+253,12
@@
fringes is not taken out of the allowance for WIDTH, unlike
(other-window 1))
(select-window win)))
(other-window 1))
(select-window win)))
+(defun mdw-frame-width-for-columns (columns width)
+ "Return the preferred width for a frame with so many COLUMNS of WIDTH."
+ (let ((sb-width (mdw-horizontal-window-overhead)))
+ (- (* columns (+ width sb-width))
+ sb-width)))
+
(defun mdw-set-frame-width (columns &optional width)
"Set the current frame to be the correct width for COLUMNS columns.
(defun mdw-set-frame-width (columns &optional width)
"Set the current frame to be the correct width for COLUMNS columns.
@@
-262,11
+268,9
@@
can be set interactively with a prefix argument.)"
P")
(setq width (if width (prefix-numeric-value width)
(mdw-preferred-column-width)))
P")
(setq width (if width (prefix-numeric-value width)
(mdw-preferred-column-width)))
- (let ((sb-width (mdw-horizontal-window-overhead)))
- (set-frame-width (selected-frame)
- (- (* columns (+ width sb-width))
- sb-width))
- (mdw-divvy-window width)))
+ (set-frame-width (selected-frame)
+ (mdw-frame-width-for-columns columns width))
+ (mdw-divvy-window width))
(defcustom mdw-frame-width-fudge
(cond ((<= emacs-major-version 20) 1)
(defcustom mdw-frame-width-fudge
(cond ((<= emacs-major-version 20) 1)