5353 (:eval (jcs-modeline--render-read-only))
5454 (:eval (jcs-modeline--render-mode-line-process)))
5555 " List of item to render on the left."
56- :type '( list symbol)
56+ :type 'list
5757 :group 'jcs-modeline )
5858
5959(defcustom jcs-modeline-right
6969 (:eval (jcs-modeline--render-percent-position))
7070 (:eval (jcs-modeline--render-end-spaces)))
7171 " List of item to render on the right."
72- :type '( list symbol)
72+ :type 'list
7373 :group 'jcs-modeline )
7474
7575(defcustom jcs-modeline-checker-colors '((error . " #FB4933" )
7676 (warning . " #FABD2F" )
7777 (info . " #83A598" )
7878 (note . " #83A598" ))
7979 " Alist of colors for checkers."
80- :type '( list symbol)
80+ :type 'list
8181 :group 'jcs-modeline )
8282
8383; ;
@@ -383,7 +383,7 @@ mouse-1: Toggle display of major mode name"
383383
384384(defun jcs-modeline--project-root ()
385385 " Return project directory path."
386- (when-let* ((current (project-current ))) (project-root current)))
386+ (when-let ((current (project-current ))) (project-root current)))
387387
388388(defcustom jcs-modeline-show-project-name-virutal-buffer nil
389389 " If non-nil, display project's name in the virutal buffer."
@@ -444,7 +444,7 @@ mouse-1: Switch project"
444444 (nerd-icons-devicon " nf-dev-git_branch" :face 'jcs-modeline-vc-face )))
445445 (Hg . , jcs-modeline-vc-unknown-icon ))
446446 " Alist of vc backends to icon."
447- :type '( list symbol)
447+ :type 'list
448448 :group 'jcs-modeline )
449449
450450(declare-function vc-git--symbolic-ref " vc-git.el" )
@@ -506,37 +506,23 @@ mouse-1: Switch project"
506506
507507(defvar text-scale-mode-amount )
508508(defvar text-scale-mode-lighter )
509- (defvar default-text-scale--complement )
510509
511510(defun jcs-modeline--render-text-scale ()
512511 " Render text-scale amount."
513- (let ((ts (and (boundp 'text-scale-mode-lighter )
514- (/= text-scale-mode-amount 0 )))
515- (dts (and (boundp 'default-text-scale--complement )
516- (/= default-text-scale--complement 0 ))))
517- (when (or ts dts)
518- (format " (%s :%s ) "
519- (if ts
520- (propertize text-scale-mode-lighter
521- 'mouse-face 'mode-line-highlight
522- 'help-echo (concat " Text scale " text-scale-mode-lighter))
523- " 0" )
524- (if-let* ((dts)
525- (delta (- 0 default-text-scale--complement))
526- (delta (format (if (>= delta 0 ) " +%d" " %d" ) delta)))
527- (propertize (jcs-modeline-2str delta)
528- 'mouse-face 'mode-line-highlight
529- 'help-echo (format " Default text scale %s " delta))
530- " 0" )))))
512+ (when (and (boundp 'text-scale-mode-lighter )
513+ (/= text-scale-mode-amount 0 ))
514+ (format " (%s ) " (propertize text-scale-mode-lighter
515+ 'mouse-face 'mode-line-highlight
516+ 'help-echo (concat " Text scale " text-scale-mode-lighter)))))
531517
532518; ;
533519; ;; Undo
534520
535521(defun jcs-modeline--render-undo-tree-buffer-name ()
536522 " Render text-scale amount."
537- (when-let* (((featurep 'undo-tree ))
538- ((equal (buffer-name ) undo-tree-visualizer-buffer-name))
539- (ind (buffer-name undo-tree-visualizer-parent-buffer)))
523+ (when-let (((featurep 'undo-tree ))
524+ ((equal (buffer-name ) undo-tree-visualizer-buffer-name))
525+ (ind (buffer-name undo-tree-visualizer-parent-buffer)))
540526 (concat " "
541527 (propertize ind
542528 'mouse-face 'mode-line-highlight
@@ -628,9 +614,9 @@ If argument RUNNING is non-nil, we turn lighter into question mark."
628614 (last (car (last states)))
629615 result)
630616 (dolist (state states)
631- (when-let* ((lighter (jcs-modeline--flymake-lighter
632- diags-by-type state
633- (or some-waiting (null known) all-disabled))))
617+ (when-let ((lighter (jcs-modeline--flymake-lighter
618+ diags-by-type state
619+ (or some-waiting (null known) all-disabled))))
634620 (setq result (concat result lighter
635621 (unless (equal state last ) " /" )))))
636622 (propertize result
@@ -660,7 +646,7 @@ If argument RUNNING is non-nil, we turn lighter into question mark."
660646 (running (eq 'running flycheck-last-status-change))
661647 result)
662648 (dolist (state states)
663- (when-let* ((lighter (jcs-modeline--flycheck-lighter state running)))
649+ (when-let ((lighter (jcs-modeline--flycheck-lighter state running)))
664650 (setq result (concat result lighter
665651 (unless (equal state last ) " /" )))))
666652 (propertize result
@@ -675,8 +661,8 @@ If argument RUNNING is non-nil, we turn lighter into question mark."
675661
676662(defun jcs-modeline--render-csv ()
677663 " Render for `csv-mode' ."
678- (when-let* (((memq major-mode '(csv-mode tsv-mode)))
679- (ind (format-mode-line csv-mode-line-format)))
664+ (when-let (((memq major-mode '(csv-mode tsv-mode)))
665+ (ind (format-mode-line csv-mode-line-format)))
680666 (concat (propertize ind
681667 'mouse-face 'mode-line-highlight
682668 'help-echo " csv" )
@@ -690,8 +676,8 @@ If argument RUNNING is non-nil, we turn lighter into question mark."
690676
691677(defun jcs-modeline--render-nov ()
692678 " Render for nov."
693- (when-let* (((eq major-mode 'nov-mode ))
694- (ind (format " [%s /%s ] " (1+ nov-documents-index) (length nov-documents))))
679+ (when-let (((eq major-mode 'nov-mode ))
680+ (ind (format " [%s /%s ] " (1+ nov-documents-index) (length nov-documents))))
695681 (propertize ind
696682 'mouse-face 'mode-line-highlight
697683 'help-echo " [current page/totla page]" )))
0 commit comments