From 0fe7ec5c1bf9ae03542e672f130c953b36c275f9 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 8 Mar 2025 18:34:33 +0100 Subject: [PATCH] Clean up own utilities collection Properly separate interactive commands from simple functions in use-package declaration, and remove two unused functions. --- init.el | 21 ++++++++++----------- site-lisp/db-utils.el | 12 ++---------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/init.el b/init.el index d75ae8b..8140c15 100644 --- a/init.el +++ b/init.el @@ -357,7 +357,6 @@ (use-package db-utils :commands (endless/fill-or-unfill - db/delete-trailing-whitespace-maybe db/run-or-hide-shell db/gnus db/org-agenda @@ -368,33 +367,33 @@ db/hex-to-ascii db/text-to-hex turn-on-lispy-when-available - turn-on-flycheck-when-file - db/sort-nsm-permanent-settings - endless/colorize-compilation - db/turn-off-local-electric-pair-mode db/two-monitors-xrandr db/one-monitor-xrandr db/pretty-print-xml db/bookmark-add-external db/bookmark-add-url + db/bookmark-add-eww db/bookmark-relocate db/bookmark-bmenu-relocate db/lookup-smime-key db/dired-from-shell-command - db/system-open db/switch-to-dark-theme db/switch-to-light-theme keyboard-quit-context+ + db/dired-ediff-files + db/dired-back-to-top + db/dired-jump-to-bottom + db/dired-get-size) + :autoload (turn-on-flycheck-when-file + db/sort-nsm-permanent-settings + endless/colorize-compilation + db/system-open db/convert-lf-to-crlf-in-buffer db/convert-crlf-to-lf-in-buffer db/replace-variables-in-string - db/dired-ediff-files db/grep-read-files db/make-selector-from-table-header - db/get-library-version - db/dired-back-to-top - db/dired-jump-to-bottom - db/dired-get-size)) + db/get-library-version)) (use-package db-hydras :commands (hydra-toggle/body diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 31fe18a..10bb263 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -173,11 +173,6 @@ With a prefix argument P, isearch for the symbol at point." fill-column))) (call-interactively #'fill-paragraph))) -(defun db/delete-trailing-whitespace-maybe () - "Call `delete-trailing-whitespace', but not in `message-mode'." - (unless (derived-mode-p 'message-mode) - (delete-trailing-whitespace))) - (defun db/find-window-by-buffer-mode (mode) "Return first window in current frame displaying a buffer with major mode MODE." (cl-find-if (lambda (window) @@ -291,11 +286,6 @@ Will print a warning in case of failure." (let ((inhibit-read-only t)) (ansi-color-apply-on-region compilation-filter-start (point)))) -(defun db/turn-off-local-electric-pair-mode () - "Locally turn off electric pair mode." - (interactive) - (electric-pair-local-mode -1)) - (defun db/pretty-print-xml () "Stupid function to pretty print XML content in current buffer." ;; We assume that < and > only occur as XML tag delimiters, not in strings; @@ -794,11 +784,13 @@ number of bytes has been inserted." (defun db/two-monitors-xrandr () "Activate second monitor using xrandr." + (interactive) (call-process "xrandr" nil nil nil "--output" "HDMI-3" "--primary" "--right-of" "LVDS-1" "--auto")) (defun db/one-monitor-xrandr () "Deactivate all additional monitors." + (interactive) (call-process "xrandr" nil nil nil "--output" "HDMI-3" "--off"))