General Elisp linting
TL;DR: - Remove `require` statements from init.el - Remove unused, auto-install KBDs for bookmark.el - Remove unused `require` statements from clipboard - Remove unused, commented-out code I would like for an Elisp linting stage to test for unused `require` statements, but I'm unsure how practical that is to support.
This commit is contained in:
		
							parent
							
								
									dffb224023
								
							
						
					
					
						commit
						4a69371065
					
				
					 6 changed files with 9 additions and 65 deletions
				
			
		|  | @ -1,42 +1,16 @@ | ||||||
| (require 'wpc-package) |  | ||||||
| 
 |  | ||||||
| ;; load order is intentional | ;; load order is intentional | ||||||
| (require 'constants) | (require 'wpc-package) | ||||||
| (require 'wpc-misc) | (require 'wpc-misc) | ||||||
| 
 |  | ||||||
| ;; my libraries |  | ||||||
| (require 'functions) |  | ||||||
| (require 'prelude) |  | ||||||
| (require 'macros) |  | ||||||
| 
 |  | ||||||
| ;; Laptop XF-functionality |  | ||||||
| (require 'pulse-audio) |  | ||||||
| (require 'screen-brightness) |  | ||||||
| 
 |  | ||||||
| ;; miscellaneous |  | ||||||
| (require 'ssh) | (require 'ssh) | ||||||
| (require 'clipboard) |  | ||||||
| (require 'battery) |  | ||||||
| (require 'bookmark) |  | ||||||
| (require 'keyboard) | (require 'keyboard) | ||||||
| (require 'irc) | (require 'irc) | ||||||
| (require 'email) | (require 'email) | ||||||
| (require 'scrot) |  | ||||||
| (require 'timestring) |  | ||||||
| 
 |  | ||||||
| ;; TODO: Remove path once published to MELPA. |  | ||||||
| ;; TODO: How can I package this using Nix? |  | ||||||
| ;; (require 'egg-timer "~/programming/egg-timer.el/egg-timer.el") |  | ||||||
| 
 |  | ||||||
| (require 'keybindings) | (require 'keybindings) | ||||||
| (require 'window-manager) | (require 'window-manager) | ||||||
| (require 'wpc-ui) | (require 'wpc-ui) | ||||||
| (require 'wpc-dired) | (require 'wpc-dired) | ||||||
| (require 'wpc-org) | (require 'wpc-org) | ||||||
| (require 'wpc-company) | (require 'wpc-company) | ||||||
| ;; TODO: Re-enable flycheck for all languages besides Elisp once I learn more |  | ||||||
| ;; about the issue with the `emacs-lisp' `flycheck-checker'. |  | ||||||
| ;; (require 'wpc-flycheck) |  | ||||||
| (require 'wpc-shell) | (require 'wpc-shell) | ||||||
| (require 'wpc-lisp) | (require 'wpc-lisp) | ||||||
| (require 'wpc-haskell) | (require 'wpc-haskell) | ||||||
|  |  | ||||||
|  | @ -33,9 +33,6 @@ | ||||||
| 
 | 
 | ||||||
| (cl-defstruct bookmark label path kbd) | (cl-defstruct bookmark label path kbd) | ||||||
| 
 | 
 | ||||||
| (defconst bookmark-install-kbds? t |  | ||||||
|   "When t, install keybindings.") |  | ||||||
| 
 |  | ||||||
| ;; TODO: Consider hosting this function somewhere other than here, since it | ;; TODO: Consider hosting this function somewhere other than here, since it | ||||||
| ;; feels useful above of the context of bookmarks. | ;; feels useful above of the context of bookmarks. | ||||||
| ;; TODO: Assess whether it'd be better to use the existing function: | ;; TODO: Assess whether it'd be better to use the existing function: | ||||||
|  | @ -82,7 +79,9 @@ Otherwise, open with `counsel-find-file'." | ||||||
|      ((f-file? path) |      ((f-file? path) | ||||||
|       (funcall bookmark-handle-file path))))) |       (funcall bookmark-handle-file path))))) | ||||||
| 
 | 
 | ||||||
| (when bookmark-install-kbds? | 
 | ||||||
|  | (defun bookmark-install-kbds () | ||||||
|  |   "Install the keybindings defined herein." | ||||||
|   (->> bookmark-whitelist |   (->> bookmark-whitelist | ||||||
|        (list-map |        (list-map | ||||||
|         (lambda (b) |         (lambda (b) | ||||||
|  |  | ||||||
|  | @ -16,13 +16,6 @@ | ||||||
| 
 | 
 | ||||||
| ;;; Code: | ;;; Code: | ||||||
| 
 | 
 | ||||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |  | ||||||
| ;; Dependencies |  | ||||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |  | ||||||
| 
 |  | ||||||
| (require 'prelude) |  | ||||||
| (require 'ivy-clipmenu) |  | ||||||
| 
 |  | ||||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||||
| ;; Library | ;; Library | ||||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||||
|  |  | ||||||
|  | @ -22,6 +22,7 @@ | ||||||
| ;; Dependencies | ;; Dependencies | ||||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||||
| 
 | 
 | ||||||
|  | (require 'functions) | ||||||
| (require 'clipboard) | (require 'clipboard) | ||||||
| (require 'screen-brightness) | (require 'screen-brightness) | ||||||
| (require 'scrot) | (require 'scrot) | ||||||
|  | @ -44,6 +45,10 @@ | ||||||
| (require 'evil-surround) | (require 'evil-surround) | ||||||
| (require 'key-chord) | (require 'key-chord) | ||||||
| 
 | 
 | ||||||
|  | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||||
|  | ;; General Keybindings | ||||||
|  | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||||||
|  | 
 | ||||||
| ;; Ensure that evil's command mode behaves with readline bindings. | ;; Ensure that evil's command mode behaves with readline bindings. | ||||||
| (general-define-key | (general-define-key | ||||||
|  :keymaps 'evil-ex-completion-map |  :keymaps 'evil-ex-completion-map | ||||||
|  | @ -110,10 +115,6 @@ | ||||||
| (key-chord-mode 1) | (key-chord-mode 1) | ||||||
| (key-chord-define evil-insert-state-map "jk" 'evil-normal-state) | (key-chord-define evil-insert-state-map "jk" 'evil-normal-state) | ||||||
| 
 | 
 | ||||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |  | ||||||
| ;; General KBDs |  | ||||||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |  | ||||||
| 
 |  | ||||||
| ;; This may be contraversial, but I never use the prefix key, and I'd prefer to | ;; This may be contraversial, but I never use the prefix key, and I'd prefer to | ||||||
| ;; have to bound to the readline function that deletes the entire line. | ;; have to bound to the readline function that deletes the entire line. | ||||||
| (general-unbind "C-u") | (general-unbind "C-u") | ||||||
|  |  | ||||||
|  | @ -128,28 +128,6 @@ | ||||||
|   "Return over `XS' calling `F' on an element in `XS'and `ACC'." |   "Return over `XS' calling `F' on an element in `XS'and `ACC'." | ||||||
|   (-reduce-from (lambda (acc x) (funcall f x acc)) acc xs)) |   (-reduce-from (lambda (acc x) (funcall f x acc)) acc xs)) | ||||||
| 
 | 
 | ||||||
| ;; TODO: Support this. It seems like `alist-set' is not working as I expected it |  | ||||||
| ;; to. Perhaps we should add some tests to confirm the expected behavior. |  | ||||||
| ;; (cl-defun list-index (f xs &key (transform (lambda (x) x))) |  | ||||||
| ;;   "Return a mapping of F applied to each x in XS to TRANSFORM applied to x. |  | ||||||
| ;; The TRANSFORM function defaults to the identity function." |  | ||||||
| ;;   (->> xs |  | ||||||
| ;;        (list-reduce (alist-new) |  | ||||||
| ;;                     (lambda (x acc) |  | ||||||
| ;;                       (let ((k (funcall f x)) |  | ||||||
| ;;                             (v (funcall transform x))) |  | ||||||
| ;;                         (if (alist-has-key? k acc) |  | ||||||
| ;;                             (setf (alist-get k acc) (list v)) |  | ||||||
| ;;                           (setf (alist-get k acc) (list v)))))))) |  | ||||||
| ;; (prelude-assert |  | ||||||
| ;;  (equal '(("John" . ("Cleese" "Malkovich")) |  | ||||||
| ;;           ("Thomas" . ("Aquinas"))) |  | ||||||
| ;;         (list-index (lambda (x) (plist-get x :first-name)) |  | ||||||
| ;;                     '((:first-name "John" :last-name "Cleese") |  | ||||||
| ;;                       (:first-name "John" :last-name "Malkovich") |  | ||||||
| ;;                       (:first-name "Thomas" :last-name "Aquinas")) |  | ||||||
| ;;                     :transform (lambda (x) (plist-get x :last-name))))) |  | ||||||
| 
 |  | ||||||
| (defun list-map (f xs) | (defun list-map (f xs) | ||||||
|   "Call `F' on each element of `XS'." |   "Call `F' on each element of `XS'." | ||||||
|   (-map f xs)) |   (-map f xs)) | ||||||
|  |  | ||||||
|  | @ -32,7 +32,6 @@ | ||||||
|   (-insert-at 0 'css-mode-hook wpc-javascript--js-hooks) |   (-insert-at 0 'css-mode-hook wpc-javascript--js-hooks) | ||||||
|   "All of the commonly user hooks for frontend development.") |   "All of the commonly user hooks for frontend development.") | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| ;; frontend indentation settings | ;; frontend indentation settings | ||||||
| (setq typescript-indent-level 2 | (setq typescript-indent-level 2 | ||||||
|       js-indent-level 2 |       js-indent-level 2 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue