From c5226e4aaec89c7abfff5d9e46322b92c008dea2 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 23 May 2019 16:47:30 +0800 Subject: [PATCH] Eliminate compiler warnings. --- doom-modeline-core.el | 2 +- doom-modeline-segments.el | 52 ++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/doom-modeline-core.el b/doom-modeline-core.el index 74647ec..912e740 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -497,7 +497,7 @@ If the actual char height is larger, it respects the actual char height.") 'mode-line 'mode-line-inactive))) -(defsubst doom-modeline--char-height () +(defsubst doom-modeline--font-height () "Calculate the actual char height of the mode-line." (ceiling (* 1.68 (frame-char-height)))) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index f5551c3..bdae97b 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -148,9 +148,9 @@ (declare-function jsonrpc-last-error 'jsonrpc) (declare-function lsp--workspace-print 'lsp-mode) (declare-function lsp-describe-session 'lsp-mode) -(declare-function lsp-restart-workspace 'lsp-mode) -(declare-function lsp-shutdown-workspace 'lsp-mode) (declare-function lsp-workspace-folders-open 'lsp-mode) +(declare-function lsp-workspace-restart 'lsp-mode) +(declare-function lsp-workspace-shutdown 'lsp-mode) (declare-function lsp-workspaces 'lsp-mode) (declare-function magit-toplevel 'magit-git) (declare-function mc/num-cursors 'multiple-cursors-core) @@ -1624,34 +1624,36 @@ mouse-3: Describe current input method") (face (if workspaces 'success 'warning)) (icon (doom-modeline-lsp-icon "LSP" face))) (propertize icon - 'help-echo (if workspaces - (concat "LSP Connected " - (string-join (--map (format "[%s]\n" (lsp--workspace-print it)) - workspaces)) - "C-mouse-1: Switch to another workspace folder + 'help-echo + (if workspaces + (concat "LSP Connected " + (string-join (--map (format "[%s]\n" (lsp--workspace-print it)) + workspaces)) + "C-mouse-1: Switch to another workspace folder mouse-1: Describe current session mouse-2: Quit server mouse-3: Reconnect to server") - "LSP Disconnected + "LSP Disconnected mouse-1: Reload to start server") 'mouse-face '(:box 0) - 'local-map (let ((map (make-sparse-keymap))) - (if workspaces - (progn - (define-key map [mode-line C-mouse-1] - #'lsp-workspace-folders-open) - (define-key map [mode-line mouse-1] - #'lsp-describe-session) - (define-key map [mode-line mouse-2] - #'lsp-shutdown-workspace) - (define-key map [mode-line mouse-3] - #'lsp-restart-workspace)) - (progn - (define-key map [mode-line mouse-1] - (lambda () - (interactive) - (revert-buffer t t))))) - map))))) + 'local-map + (let ((map (make-sparse-keymap))) + (if workspaces + (progn + (define-key map [mode-line C-mouse-1] + #'lsp-workspace-folders-open) + (define-key map [mode-line mouse-1] + #'lsp-describe-session) + (define-key map [mode-line mouse-2] + #'lsp-workspace-shutdown) + (define-key map [mode-line mouse-3] + #'lsp-workspace-restart)) + (progn + (define-key map [mode-line mouse-1] + (lambda () + (interactive) + (revert-buffer t t))))) + map))))) (add-hook 'lsp-mode-hook #'doom-modeline-update-lsp) (add-hook 'lsp-after-uninitialized-hook #'doom-modeline-update-lsp)