From 10c464b51345ea5f3f627aa0ba97a924158709a4 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sat, 29 May 2021 18:43:04 +0800 Subject: modeline: do not use bars anymore * modeline.el (modeline-format-left): Remove the commented line about bars. (modeline-bar-width): (modeline-bar-height): (modeline-bar-color): (modeline-bar-color-inactive): (modeline-bar-img): (modeline-bar-img-inactive): (modeline-refresh-bars): (modeline-format-bar): These are removed. --- modeline.el | 119 ------------------------------------------------------------ 1 file changed, 119 deletions(-) (limited to 'modeline.el') diff --git a/modeline.el b/modeline.el index 91b5b17..49ad135 100644 --- a/modeline.el +++ b/modeline.el @@ -58,7 +58,6 @@ (defun modeline-format-left () "The left mode line format." (concat - ;; (modeline-format-bar) (modeline-spc) (modeline-format-buffer-status) (modeline-spc) @@ -227,124 +226,6 @@ MAP is the local keymap of the text." 'mode-line) (t 'mode-line-inactive)))) -;;;###autoload -(defvar modeline-bar-width 3 - "The width of the mode line bar") - -;;;###autoload -(defvar modeline-bar-height 27 - "The height of the mode line bar") - -;;;###autoload -(defvar modeline-bar-color (face-background 'modus-theme-active-blue nil t) - "The color for the bar of the mode line.") - -;;;###autoload -(defvar modeline-bar-color-inactive (face-foreground 'mode-line-inactive) - "The color for the bar of inactive mode lines.") - -;;;###autoload -(defvar modeline-bar-img - (propertize - " " 'display - (let ((data (make-list modeline-bar-height - (make-list modeline-bar-width 97))) - (color modeline-bar-color)) - (ignore-errors - (create-image - (concat - "/* XPM */\nstatic char * bar[]={\n" - (format "\"%d %d 1 1\",\n\"a c %s\",\n" - modeline-bar-width modeline-bar-height - color) - (mapconcat - (lambda (row) - (format "\"%s\"" - (apply #'string row))) - data ",\n") - "\n};") - 'xpm t :ascent 'center)))) - "The image for the bar in the mode line.") - -;;;###autoload -(defvar modeline-bar-img-inactive - (propertize - " " 'display - (let ((data (make-list modeline-bar-height - (make-list modeline-bar-width 97))) - (color modeline-bar-color-inactive)) - (ignore-errors - (create-image - (concat - "/* XPM */\nstatic char * bar[]={\n" - (format "\"%d %d 1 1\",\n\"a c %s\",\n" - modeline-bar-width modeline-bar-height - color) - (mapconcat - (lambda (row) - (format "\"%s\"" - (apply #'string row))) - data ",\n") - "\n};") - 'xpm t :ascent 'center)))) - "The image for the bar in inactive mode lines.") - -;;;###autoload -(defun modeline-refresh-bars (&optional w h) - "Refresh the bar images. -W is the width, H is the height of the bar." - (setq modeline-bar-width (or w modeline-bar-width) - modeline-bar-height (or h modeline-bar-height) - modeline-bar-img - (propertize - " " 'display - (let ((data (make-list modeline-bar-height - (make-list modeline-bar-width 97))) - (color modeline-bar-color)) - (ignore-errors - (create-image - (concat - "/* XPM */\nstatic char * bar[]={\n" - (format "\"%d %d 1 1\",\n\"a c %s\",\n" - modeline-bar-width modeline-bar-height - color) - (mapconcat - (lambda (row) - (format "\"%s\"" - (apply #'string row))) - data ",\n") - "\n};") - 'xpm t :ascent 'center)))) - modeline-bar-img-inactive - (propertize - " " 'display - (let ((data (make-list modeline-bar-height - (make-list modeline-bar-width 97))) - (color modeline-bar-color-inactive)) - (ignore-errors - (create-image - (concat - "/* XPM */\nstatic char * bar[]={\n" - (format "\"%d %d 1 1\",\n\"a c %s\",\n" - modeline-bar-width modeline-bar-height - color) - (mapconcat - (lambda (row) - (format "\"%s\"" - (apply #'string row))) - data ",\n") - "\n};") - 'xpm t :ascent 'center)))))) - -;;;###autoload -(defun modeline-format-bar () - "We need a bar to ensure the mode line has the specified height." - (cond - ((and (display-graphic-p) - (image-type-available-p 'xpm)) - (cond ((modeline-active-window-p) modeline-bar-img) - (t modeline-bar-img-inactive))))) - ;;;###autoload (defun modeline-format-buffer-status () "The status of the buffer displayed on the mode-line." -- cgit v1.2.3-18-g5258