From 0f9e8e769e0f342f85ac334c1ccddfd89847d94e Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 27 Jan 2021 12:22:40 +0100 Subject: [PATCH] Emacsg: Silence byte-compiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit when running "touch init.el; emacs", then the compilation triggered by `auto-compile-on-load-mode' resulted in: Warning (bytecomp): the following functions might not be defined at runtime: server-running-p, magit-add-section-hook Warning (bytecomp): the following functions are not known to be defined: indent-spaces-mode, indicate-buffer-boundaries-left While "make build-init" only resulted in: init.el:193:1: Warning: the function ‘magit-add-section-hook’ might not be defined at runtime. This commit addresses all of these warnings: - Don't sharp quote functions, because they resulted in invalid warnings. - Use the `use-package' keyword `:commands' to suppress the other warnings, because `:functions' fails to its job even though theoretically it is more suitable in these cases. --- init.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index cafb6c3..5780d87 100644 --- a/init.el +++ b/init.el @@ -57,6 +57,7 @@ (load custom-file))) (use-package server + :commands (server-running-p) :config (or (server-running-p) (server-mode))) (progn ; startup @@ -104,10 +105,11 @@ (add-hook 'emacs-lisp-mode-hook 'reveal-mode) (defun indent-spaces-mode () (setq indent-tabs-mode nil)) - (add-hook 'lisp-interaction-mode-hook #'indent-spaces-mode)) + (add-hook 'lisp-interaction-mode-hook 'indent-spaces-mode)) (use-package magit :defer t + :commands (magit-add-section-hook) :config (magit-add-section-hook 'magit-status-sections-hook 'magit-insert-modules @@ -125,7 +127,7 @@ :config (global-prettify-symbols-mode) (defun indicate-buffer-boundaries-left () (setq indicate-buffer-boundaries 'left)) - (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left)) + (add-hook 'prog-mode-hook 'indicate-buffer-boundaries-left)) (use-package recentf :demand t @@ -149,7 +151,7 @@ (set-face-attribute 'smerge-refined-added nil :extend t))) (progn ; `text-mode' - (add-hook 'text-mode-hook #'indicate-buffer-boundaries-left)) + (add-hook 'text-mode-hook 'indicate-buffer-boundaries-left)) (use-package tramp :defer t