Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Emacs 28-specific warnings. #10

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions init-dir.el
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ ROOT-DIR: Directory root being loaded from."
(push (format "Loading `%s' took %f seconds. %s "
(init-dir--make-file-link file root-dir)
duration
(if (not (fboundp 'buttonize)) ;Requires GNU Emacs 29.1
""
(buttonize "[Timing]" #'init-dir--show-timing file)))
(if (fboundp 'buttonize) ;Requires GNU Emacs 29.1
(buttonize "[Timing]" #'init-dir--show-timing file)
""))
init-dir--error-and-warning-list)))))

(defun init-dir--make-file-link (file root-dir)
Expand All @@ -193,12 +193,12 @@ Clicking the text will open the FILE, as if by `find-file'.

FILE: An absolute path to a file.
ROOT-DIR: Directory root that file is in."
(if (not (fboundp 'buttonize)) ;Requires GNU Emacs 29.1
file
(buttonize (file-relative-name file root-dir)
#'find-file
file
"Visit this file")))
(if (fboundp 'buttonize) ;Requires GNU Emacs 29.1
(buttonize (file-relative-name file root-dir)
#'find-file
file
"Visit this file")
file))

(defun init-dir--choose-as-load (file)
"Return FILE with the suffix `load' would add."
Expand Down Expand Up @@ -278,26 +278,25 @@ automatically by `init-dir-load'."

(defun init-dir--make-install-packages-button ()
"Return clickable text to install missing packages."
(if (not (fboundp 'buttonize)) ;Requires GNU Emacs 29.1
""
(buttonize "[Fix]"
(lambda (&rest _) (package-install-selected-packages))
nil
"Install all missing packages")))
(if (fboundp 'buttonize) ;Requires GNU Emacs 29.1
(buttonize "[Fix]"
(lambda (&rest _) (package-install-selected-packages))
nil
"Install all missing packages")
""))

(defun init-dir--make-upgrade-packages-button (packages)
"Return clickable text to upgrade packages.

PACKAGES: List of package symbols to upgrade when the button is clicked."
(if (and (not (fboundp 'buttonize)) ;Requires GNU Emacs 29.1
(not (fboundp 'package-upgrade))) ;Requires GNU Emacs 29.1
""
(buttonize "[Fix]"
(lambda (list) (mapc 'package-upgrade ;FIXME: Using quote instead of function to
;suppress byte-compiler warning on pre 29.1
list))
packages
"Upgrade all packages")))
(if (and (fboundp 'buttonize) ;Requires GNU Emacs 29.1
(fboundp 'package-upgrade)) ;Requires GNU Emacs 29.1
(buttonize "[Fix]"
(lambda (list) (mapc #'package-upgrade
list))
packages
"Upgrade all packages")
""))

;;; Customize variables:

Expand Down