bunch of stuff that doesn't matter
This commit is contained in:
@@ -1 +1 @@
|
||||
(((min-height . 8) (min-width . 20) (min-height-ignore . 6) (min-width-ignore . 8) (min-height-safe . 2) (min-width-safe . 4) (min-pixel-height . 144) (min-pixel-width . 160) (min-pixel-height-ignore . 108) (min-pixel-width-ignore . 64) (min-pixel-height-safe . 36) (min-pixel-width-safe . 32)) hc (pixel-width . 1910) (pixel-height . 1009) (total-width . 239) (total-height . 56) (normal-height . 1.0) (normal-width . 1.0) (combination-limit . t) (vc (pixel-width . 1184) (pixel-height . 1009) (total-width . 148) (total-height . 56) (normal-height . 1.0) (normal-width . 0.6198952879581152) (combination-limit) (leaf (pixel-width . 1184) (pixel-height . 682) (total-width . 148) (total-height . 38) (normal-height . 0.6778989098116948) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . command)) (buffer " *gdb-placeholder*" (selected . t) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) (leaf (last . t) (pixel-width . 1184) (pixel-height . 327) (total-width . 148) (total-height . 18) (normal-height . 0.32210109018830524) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . gdb-breakpoints-buffer)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated . t) (point . 1) (start . 1)))) (vc (last . t) (pixel-width . 726) (pixel-height . 1009) (total-width . 91) (total-height . 56) (normal-height . 1.0) (normal-width . 0.38010471204188484) (combination-limit) (leaf (pixel-width . 726) (pixel-height . 776) (total-width . 91) (total-height . 43) (normal-height . 0.7670961347869177) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . source)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) (leaf (last . t) (pixel-width . 726) (pixel-height . 233) (total-width . 91) (total-height . 13) (normal-height . 0.23290386521308226) (normal-width . 1.0) (parameters (gdb-buffer-type . gdb-inferior-io)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated . t) (point . 1) (start . 1)))))
|
||||
(((min-height . 12) (min-width . 20) (min-height-ignore . 9) (min-width-ignore . 6) (min-height-safe . 3) (min-width-safe . 4) (min-pixel-height . 288) (min-pixel-width . 200) (min-pixel-height-ignore . 216) (min-pixel-width-ignore . 60) (min-pixel-height-safe . 72) (min-pixel-width-safe . 40)) hc (pixel-width . 1910) (pixel-height . 1025) (total-width . 191) (total-height . 43) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 880) (pixel-height . 1025) (total-width . 88) (total-height . 43) (normal-height . 1.0) (normal-width . 0.46073298429319376) (parameters (context) (gdb-buffer-type . source)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) (vc (last . t) (pixel-width . 1030) (pixel-height . 1025) (total-width . 103) (total-height . 43) (normal-height . 1.0) (normal-width . 0.5392670157068062) (combination-limit) (leaf (pixel-width . 1030) (pixel-height . 360) (total-width . 103) (total-height . 15) (normal-height . 0.35121951219512193) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . gdb-breakpoints-buffer)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated . t) (point . 1) (start . 1))) (leaf (pixel-width . 1030) (pixel-height . 336) (total-width . 103) (total-height . 14) (normal-height . 0.3278048780487805) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . command)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) (leaf (last . t) (pixel-width . 1030) (pixel-height . 329) (total-width . 103) (total-height . 14) (normal-height . 0.32097560975609757) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . gdb-inferior-io)) (buffer " *gdb-placeholder*" (selected . t) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated . t) (point . 1) (start . 1)))))
|
||||
@@ -38,20 +38,21 @@
|
||||
(defvar bml/--minimum-padding 4
|
||||
"Minimum size of padding string.")
|
||||
|
||||
(defun bml/--get-padding-size (other-size)
|
||||
"Compute length of padding to ensure string of size OTHER-SIZE is on an
|
||||
extreme end to CENTRE-SEGMENT."
|
||||
(let ((centre-size (length (format-mode-line bml/centre-segment)))
|
||||
(window-width ;; compute total width of window (including margins)
|
||||
(thread-last (cons (window-width) (window-margins))
|
||||
(mapcar (lambda (x) (if (null x) 0 x)))
|
||||
(cl-reduce #'+))))
|
||||
(floor (- (/ window-width 2) (/ centre-size 2) other-size))))
|
||||
(defun bml/--get-left-padding-size ()
|
||||
(let* ((left-segment-size (length (format-mode-line bml/left-segment)))
|
||||
(centre-size (length (format-mode-line bml/centre-segment)))
|
||||
(window-margins (window-margins))
|
||||
(window-width (thread-last
|
||||
(cons (window-width)
|
||||
(if (null (car window-margins))
|
||||
(list 0)
|
||||
(list (car window-margins) (cdr window-margins))))
|
||||
(cl-reduce #'+))))
|
||||
(floor (- (/ window-width 2) (/ centre-size 2) left-segment-size))))
|
||||
|
||||
(defun bml/--generate-padding (segment)
|
||||
(defun bml/--generate-left-padding ()
|
||||
"Make padding string to separate center segment from SEGMENT."
|
||||
(let* ((segment-size (length (format-mode-line segment)))
|
||||
(padding-size (bml/--get-padding-size segment-size)))
|
||||
(let ((padding-size (bml/--get-left-padding-size)))
|
||||
(make-string (max padding-size bml/--minimum-padding) ?\s)))
|
||||
|
||||
(defun bml/setup-mode-line ()
|
||||
@@ -60,8 +61,7 @@ extreme end to CENTRE-SEGMENT."
|
||||
- segments are updated."
|
||||
(setq-default mode-line-format
|
||||
`(,bml/left-segment
|
||||
(:eval (bml/--generate-padding
|
||||
bml/left-segment))
|
||||
(:eval (bml/--generate-left-padding))
|
||||
,bml/centre-segment
|
||||
;; NOTE: Emacs 30!
|
||||
mode-line-format-right-align
|
||||
|
||||
Reference in New Issue
Block a user