Fix startup complaining
This commit is contained in:
parent
af3eb37c8e
commit
21b5d80814
39
init.el
39
init.el
|
@ -115,7 +115,6 @@
|
||||||
(add-to-list '+custom-variable-allowlist var))
|
(add-to-list '+custom-variable-allowlist var))
|
||||||
;; Load customizations now, and after init (to capture other possible
|
;; Load customizations now, and after init (to capture other possible
|
||||||
;; variables I want to load) XXX: this is dumb
|
;; variables I want to load) XXX: this is dumb
|
||||||
(+custom-load-ignoring-most-customizations)
|
|
||||||
(+with-ensure-after-init
|
(+with-ensure-after-init
|
||||||
(+custom-load-ignoring-most-customizations))
|
(+custom-load-ignoring-most-customizations))
|
||||||
(advice-add #'custom-buffer-create-internal :after #'+cus-edit-expand-widgets)
|
(advice-add #'custom-buffer-create-internal :after #'+cus-edit-expand-widgets)
|
||||||
|
@ -507,21 +506,21 @@
|
||||||
(:require +finger) ; fixes `finger' to use var below
|
(:require +finger) ; fixes `finger' to use var below
|
||||||
(:option finger-X.500-host-regexps '(".") ; only send username
|
(:option finger-X.500-host-regexps '(".") ; only send username
|
||||||
)
|
)
|
||||||
(require 'transient)
|
(with-eval-after-load 'transient
|
||||||
(transient-define-prefix net-utils ()
|
(transient-define-prefix net-utils ()
|
||||||
"Networking utilities"
|
"Networking utilities"
|
||||||
["Actions"
|
["Actions"
|
||||||
("p" "Ping" ping)
|
("p" "Ping" ping)
|
||||||
("i" "Ifconfig" ifconfig)
|
("i" "Ifconfig" ifconfig)
|
||||||
("w" "Iwconfig" iwconfig)
|
("w" "Iwconfig" iwconfig)
|
||||||
("n" "Netstat" netstat)
|
("n" "Netstat" netstat)
|
||||||
("a" "Arp" arp)
|
("a" "Arp" arp)
|
||||||
("r" "Route" route)
|
("r" "Route" route)
|
||||||
("h" "Nslookup host" nslookup-host)
|
("h" "Nslookup host" nslookup-host)
|
||||||
("d" "Dig" dig)
|
("d" "Dig" dig)
|
||||||
("s" "Smb Client" smbclient)
|
("s" "Smb Client" smbclient)
|
||||||
("t" "Traceroute" traceroute)])
|
("t" "Traceroute" traceroute)])
|
||||||
(:+key "C-z M-n" #'net-utils))
|
(:+key "C-z M-n" #'net-utils)))
|
||||||
|
|
||||||
(setup notmuch
|
(setup notmuch
|
||||||
(:load-from "~/usr/share/emacs/site-lisp/")
|
(:load-from "~/usr/share/emacs/site-lisp/")
|
||||||
|
@ -1051,9 +1050,11 @@
|
||||||
|
|
||||||
(setup (:straight bbdb)
|
(setup (:straight bbdb)
|
||||||
(:straight bbdb-vcard)
|
(:straight bbdb-vcard)
|
||||||
(:require bbdb-autoloads
|
(add-hook '+custom-after-load-hook
|
||||||
bbdb)
|
(defun +bbdb-load ()
|
||||||
(bbdb-initialize 'gnus 'message))
|
(:require bbdb-autoloads
|
||||||
|
bbdb)
|
||||||
|
(bbdb-initialize 'gnus 'message))))
|
||||||
|
|
||||||
(setup (:straight (bongo :type git
|
(setup (:straight (bongo :type git
|
||||||
:flavor melpa
|
:flavor melpa
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'apheleia)
|
|
||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
|
|
||||||
;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623
|
;; https://github.com/raxod502/apheleia/pull/63#issue-1077529623
|
||||||
|
@ -14,49 +13,5 @@
|
||||||
(point-max))
|
(point-max))
|
||||||
(funcall callback)))
|
(funcall callback)))
|
||||||
|
|
||||||
|
|
||||||
;;; `setup' integration
|
|
||||||
|
|
||||||
(require 'setup)
|
|
||||||
|
|
||||||
(setup-define :apheleia
|
|
||||||
(lambda (name formatter &optional mode -pend)
|
|
||||||
(let* ((mode (or mode (setup-get 'mode)))
|
|
||||||
(current-formatters (and -pend
|
|
||||||
(alist-get mode apheleia-formatters))))
|
|
||||||
`(progn
|
|
||||||
(setf (alist-get ',name apheleia-formatters)
|
|
||||||
,formatter)
|
|
||||||
(setf (alist-get ',mode apheleia-mode-alist)
|
|
||||||
',(pcase -pend
|
|
||||||
(:append (append (ensure-list current-formatters)
|
|
||||||
(list name)))
|
|
||||||
(:prepend (cons name (ensure-list current-formatters)))
|
|
||||||
('nil name)
|
|
||||||
(_ (error "Improper `:apheleia' -PEND argument")))))))
|
|
||||||
:documentation
|
|
||||||
"Register a formatter to `apheleia''s lists.
|
|
||||||
NAME is the name given to the formatter in `apheleia-formatters'
|
|
||||||
and `apheleia-mode-alist'. FORMATTER is the command paired with
|
|
||||||
NAME in `apheleia-formatters'. MODE is the mode or modes to add
|
|
||||||
NAME to in `apheleia-mode-alist'. If MODE is not given or nil,
|
|
||||||
use the setup form's MODE. Optional argument -PEND can be one of
|
|
||||||
`:append' or `:prepend', and if given will append or prepend the
|
|
||||||
given NAME to the current formatters for the MODE in
|
|
||||||
`apheleia-mode-alist', rather than replace them (the default).
|
|
||||||
|
|
||||||
Example:
|
|
||||||
(setup
|
|
||||||
(:apheleia isort (\"isort\" \"--stdout\" \"-\")
|
|
||||||
python-mode))
|
|
||||||
; =>
|
|
||||||
(progn
|
|
||||||
(setf (alist-get 'isort apheleia-formatters)
|
|
||||||
'(\"isort\" \"--stdout\" \"-\"))
|
|
||||||
(setf (alist-get 'python-mode apheleia-mode-alist)
|
|
||||||
'isort))
|
|
||||||
|
|
||||||
This form cannot be repeated, and it cannot be used as HEAD.")
|
|
||||||
|
|
||||||
(provide '+apheleia)
|
(provide '+apheleia)
|
||||||
;;; +apheleia.el ends here
|
;;; +apheleia.el ends here
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
(defcustom +compile-function nil
|
(defcustom +compile-function nil
|
||||||
"Function to run to \"compile\" a buffer."
|
"Function to run to \"compile\" a buffer."
|
||||||
:type 'function
|
:type 'function
|
||||||
:local t)
|
:local t
|
||||||
|
:risky nil)
|
||||||
|
|
||||||
(defun +compile-dispatch (&optional arg)
|
(defun +compile-dispatch (&optional arg)
|
||||||
"Run `+compile-function', if bound, or `compile'.
|
"Run `+compile-function', if bound, or `compile'.
|
||||||
|
|
|
@ -33,6 +33,9 @@
|
||||||
(defcustom +custom-variable-allowlist nil
|
(defcustom +custom-variable-allowlist nil
|
||||||
"Variables to allow changing while loading the Custom file.")
|
"Variables to allow changing while loading the Custom file.")
|
||||||
|
|
||||||
|
(defcustom +custom-after-load-hook nil
|
||||||
|
"Functions to run after loading the custom file.")
|
||||||
|
|
||||||
(defun +custom-load-ignoring-most-customizations (&optional
|
(defun +custom-load-ignoring-most-customizations (&optional
|
||||||
error
|
error
|
||||||
nomessage
|
nomessage
|
||||||
|
@ -55,7 +58,8 @@ pass t to it."
|
||||||
(memq (car el)
|
(memq (car el)
|
||||||
+custom-variable-allowlist))
|
+custom-variable-allowlist))
|
||||||
args)))))
|
args)))))
|
||||||
(load custom-file (not error) nomessage nosuffix must-suffix)))
|
(load custom-file (not error) nomessage nosuffix must-suffix))
|
||||||
|
(run-hooks '+custom-after-load-hook))
|
||||||
|
|
||||||
(defun +cus-edit-expand-widgets (&rest _)
|
(defun +cus-edit-expand-widgets (&rest _)
|
||||||
"Expand descriptions in `Custom-mode' buffers."
|
"Expand descriptions in `Custom-mode' buffers."
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
(advice-add fn :after #'+nyan-mode--fmlu)
|
(advice-add fn :after #'+nyan-mode--fmlu)
|
||||||
(advice-remove fn #'+nyan-mode--fmlu))))
|
(advice-remove fn #'+nyan-mode--fmlu))))
|
||||||
|
|
||||||
|
(defface +nyan-mode-line nil
|
||||||
|
"Face for the nyan-mode mode-line indicator.")
|
||||||
|
|
||||||
(define-minor-mode +nyan-local-mode
|
(define-minor-mode +nyan-local-mode
|
||||||
"My very own `nyan-mode' that isn't global and doesn't update the mode-line."
|
"My very own `nyan-mode' that isn't global and doesn't update the mode-line."
|
||||||
:global nil
|
:global nil
|
||||||
|
|
|
@ -43,6 +43,9 @@ it includes the NAME of the setup form in the warning output."
|
||||||
name)
|
name)
|
||||||
,body)))
|
,body)))
|
||||||
|
|
||||||
|
|
||||||
|
;;; New forms
|
||||||
|
|
||||||
(setup-define :quit
|
(setup-define :quit
|
||||||
'setup-quit
|
'setup-quit
|
||||||
:documentation "Quit the current `setup' form.
|
:documentation "Quit the current `setup' form.
|
||||||
|
@ -77,7 +80,16 @@ If PATH does not exist, abort the evaluation."
|
||||||
(file-name-nondirectory
|
(file-name-nondirectory
|
||||||
(directory-file-name (cadr args))))))
|
(directory-file-name (cadr args))))))
|
||||||
|
|
||||||
|
(setup-define :needs
|
||||||
|
(lambda (executable)
|
||||||
|
`(unless (executable-find ,executable)
|
||||||
|
,(setup-quit)))
|
||||||
|
:documentation "If EXECUTABLE is not in the path, stop here."
|
||||||
|
:repeatable 1)
|
||||||
|
|
||||||
|
|
||||||
|
;;; Package integrations
|
||||||
|
|
||||||
;;; Straight.el
|
;;; Straight.el
|
||||||
|
|
||||||
(defun setup--straight-handle-arg (arg var)
|
(defun setup--straight-handle-arg (arg var)
|
||||||
|
@ -127,12 +139,46 @@ The following keyword arguments are also recognized:
|
||||||
(let ((recipe (cadr sexp)))
|
(let ((recipe (cadr sexp)))
|
||||||
(or (car-safe recipe) recipe)))))
|
(or (car-safe recipe) recipe)))))
|
||||||
|
|
||||||
(setup-define :needs
|
;;; Apheleia
|
||||||
(lambda (executable)
|
|
||||||
`(unless (executable-find ,executable)
|
(setup-define :apheleia
|
||||||
,(setup-quit)))
|
(lambda (name formatter &optional mode -pend)
|
||||||
:documentation "If EXECUTABLE is not in the path, stop here."
|
(let* ((mode (or mode (setup-get 'mode)))
|
||||||
:repeatable 1)
|
(current-formatters (and -pend
|
||||||
|
(alist-get mode apheleia-formatters))))
|
||||||
|
`(with-eval-after-load 'apheleia
|
||||||
|
(setf (alist-get ',name apheleia-formatters)
|
||||||
|
,formatter)
|
||||||
|
(setf (alist-get ',mode apheleia-mode-alist)
|
||||||
|
',(pcase -pend
|
||||||
|
(:append (append (ensure-list current-formatters)
|
||||||
|
(list name)))
|
||||||
|
(:prepend (cons name (ensure-list current-formatters)))
|
||||||
|
('nil name)
|
||||||
|
(_ (error "Improper `:apheleia' -PEND argument")))))))
|
||||||
|
:documentation
|
||||||
|
"Register a formatter to `apheleia''s lists.
|
||||||
|
NAME is the name given to the formatter in `apheleia-formatters'
|
||||||
|
and `apheleia-mode-alist'. FORMATTER is the command paired with
|
||||||
|
NAME in `apheleia-formatters'. MODE is the mode or modes to add
|
||||||
|
NAME to in `apheleia-mode-alist'. If MODE is not given or nil,
|
||||||
|
use the setup form's MODE. Optional argument -PEND can be one of
|
||||||
|
`:append' or `:prepend', and if given will append or prepend the
|
||||||
|
given NAME to the current formatters for the MODE in
|
||||||
|
`apheleia-mode-alist', rather than replace them (the default).
|
||||||
|
|
||||||
|
Example:
|
||||||
|
(setup
|
||||||
|
(:apheleia isort (\"isort\" \"--stdout\" \"-\")
|
||||||
|
python-mode))
|
||||||
|
; =>
|
||||||
|
(progn
|
||||||
|
(setf (alist-get 'isort apheleia-formatters)
|
||||||
|
'(\"isort\" \"--stdout\" \"-\"))
|
||||||
|
(setf (alist-get 'python-mode apheleia-mode-alist)
|
||||||
|
'isort))
|
||||||
|
|
||||||
|
This form cannot be repeated, and it cannot be used as HEAD.")
|
||||||
|
|
||||||
|
|
||||||
;;; Redefines of `setup' forms
|
;;; Redefines of `setup' forms
|
||||||
|
|
Loading…
Reference in New Issue