Skip to content

Commit

Permalink
Adding more declarations, to hopefully remove byte compile warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
chaosemer committed Jul 30, 2024
1 parent c6d81c7 commit 7a8d07b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions 00.required-libraries.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ minor modes on a major mode."
else if (listp expr)
collect expr
else do (error "%s does not appear to name a minor mode" expr))))
`(hook-mode-attach ',hook (lambda () "Auto-generated by `hook-mode'"
,@body))))
`(progn
;; Prevent byte-compile errors when running elisp-check.
(defvar ,hook)
(hook-mode-attach ',hook (lambda () "Auto-generated by `hook-mode'"
,@body)))))

(defvar hook-mode-*hooks* (make-hash-table :test #'eq))
(defun hook-mode-attach (hook function)
Expand Down
5 changes: 5 additions & 0 deletions c.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@

;; ebrowse's default prefix key binding of "C-c C m -" is EXTREMELY
;; inconvenient. Nothing else uses C-c C, so I'm moving it to that.
(defvar ebrowse-global-prefix-key)
(setf ebrowse-global-prefix-key (kbd "C-c C"))

;;; Custom commands:

;; Make CC-Mode's defun finding include any function comments that
;; immediately preceede it.
(declare-function c-beginning-of-defun "cc-cmds")
(declare-function c-backward-single-comment "cc-engine")
(defun my-c-beginning-of-defun (&optional arg)
"Move backward to the beginning of a defun, including comments.
Expand All @@ -62,6 +65,8 @@ ARG: Number of defuns to move, as in `c-beginning-of-defun'."
(re-search-forward "\\(?:\\s \\|[\n\r]\\)*" nil t)))

;; Make CScope use next-error functionality, so "C-x `" works correctly
(defvar cscope-output-buffer-name)
(declare-function cscope-call "cscope")
(defun cscope-next-error (n &optional reset)
"Advance to the next error message and visit the file where the error was.
This is the value of `next-error-function' in CScope buffers.
Expand Down
1 change: 1 addition & 0 deletions dired.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
;;; init/dired.el --- Dired mode customizations -*- lexical-binding: t; -*-

;;; Code:
(declare-function dired-icon-mode "dired-icon")
(hook-mode dired-mode-hook

Check warning on line 5 in dired.el

View workflow job for this annotation

GitHub Actions / test (29.4, byte-compile)

the function ‘hook-mode’ is not known to be defined.
(when window-system
(dired-icon-mode 1))
Expand Down
1 change: 1 addition & 0 deletions early-init.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
;;; Code:
;; `early-init-file' is set after the early init process, which serves
;; as a clear flag.
(defvar modus-themes-headings)
(unless early-init-file
(setf modus-themes-headings
'((1 . (variable-pitch (height 1.5)))
Expand Down

0 comments on commit 7a8d07b

Please sign in to comment.