]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Remove some redundant "require" forms during startup
authorEshel Yaron <eshel@areionsec.com>
Sun, 8 May 2022 07:26:19 +0000 (10:26 +0300)
committerEshel Yaron <eshel@areionsec.com>
Sun, 8 May 2022 07:30:43 +0000 (10:30 +0300)
Notably, remove hide-mode-line altogether and replace its only usage
with a customization to display-buffer-alist, following a suggestion
from Protesilaos Stavrou.

.emacs.d/esy.org

index 211ab0d69580fc4422c7fe1e10b3a898ca3b0272..3ae0c3822b3b24f5b7cd7e9e2fb7c7a86775d7a5 100644 (file)
@@ -122,7 +122,7 @@ For further information about Elisp headers, see [[info:elisp#Library
           lorem-ipsum magit-todos marginalia move-dup no-littering
           ns-auto-titlebar ob-prolog orderless org-superstar paredit
           pdf-tools rainbow-delimiters rg smtpmail-multi tramp typit
-          vterm vundo which-key whitespace-cleanup-mode hide-mode-line))
+          vterm vundo which-key whitespace-cleanup-mode))
 
   (package-install-selected-packages)
 #+end_src
@@ -275,22 +275,15 @@ For further information about Elisp headers, see [[info:elisp#Library
   (defconst esy/inbox-path "~/inbox.org"
     "Path to my Org mode inbox file.")
 
-  (defun esy/setup-initial-org-config ()
-    "Setup initial `org-mode' configuration."
-    (require 'org)
-    (require 'org-habit)
+  (with-eval-after-load 'org
+    (require 'org-superstar)
+    (require 'ob)
+    (require 'ob-prolog)
     (setq org-agenda-files `(,esy/inbox-path)
           org-default-notes-file esy/inbox-path
           org-agenda-start-on-weekday 0
-          org-ellipsis "…"))
-
-  (esy/setup-initial-org-config)
-
-  (defun esy/setup-org-config ()
-    "Configure `org-mode' specific customizations."
-    (require 'ob)
-    (require 'ob-prolog)
-    (setq org-todo-keywords '((sequence
+          org-ellipsis "…"
+          org-todo-keywords '((sequence
                                "TODO(t)"
                                "BLOCKED(b@/!)"
                                "INPROGRESS(i!)"
@@ -305,13 +298,9 @@ For further information about Elisp headers, see [[info:elisp#Library
           org-log-done 'time
           org-log-into-drawer t
           org-use-fast-todo-selection 'expert
-          org-clock-in-switch-to-state "INPROGRESS"))
-
-  (add-hook 'after-init-hook #'esy/setup-org-config)
-
-  (require 'org-superstar)
-  (add-hook 'org-mode-hook #'org-superstar-mode)
-
+          org-clock-in-switch-to-state "INPROGRESS")
+    (add-hook 'org-mode-hook #'org-superstar-mode)
+    (keymap-unset org-mode-map "C-," t))
 #+end_src
 
 ** Interactively fill missing CUSTOM_ID properties
@@ -355,7 +344,7 @@ For further information about Elisp headers, see [[info:elisp#Library
     "Local path of my website sources")
 
   (defconst esy/website-source-org (expand-file-name "org"
-                                                      esy/website-source-root)
+                                                     esy/website-source-root)
     "Local path of my website Org files")
 
   (defconst esy/website-target-root "/ssh:root@direct.eshelyaron.com:/var/www"
@@ -399,9 +388,7 @@ For further information about Elisp headers, see [[info:elisp#Library
        :publishing-function org-publish-attachment)
     "Template for the static assets of my website")
 
-  (defun esy/setup-publish ()
-    "Configure `org-mode'-based publishing."
-    (require 'ox-publish)
+  (with-eval-after-load 'ox-publish
     (require 'ox-html)
     (require 'htmlize)
     (setq org-export-with-section-numbers nil
@@ -444,8 +431,6 @@ For further information about Elisp headers, see [[info:elisp#Library
             ("eshelyaron.local" :components ("index.local"
                                              "static.local"
                                              "config.local")))))
-
-  (add-hook 'after-init-hook #'esy/setup-publish)
 #+end_src
 
 ** Org-mode capture templates
@@ -601,15 +586,6 @@ For further information about Elisp headers, see [[info:elisp#Library
         '(("P" (list project-current))))
 #+end_src
 
-** Unset =org-mode= binding of =C-,= to =org-cycle-agenda-files=       :kbd:
-:PROPERTIES:
-:CUSTOM_ID: org-bindings
-:END:
-
-#+begin_src emacs-lisp
-  (keymap-unset org-mode-map "C-," t)
-#+end_src
-
 * Email settings                                                       :mail:
 :PROPERTIES:
 :CUSTOM_ID: email
@@ -778,14 +754,6 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+begin_src emacs-lisp
   (defun esy/customize-ctl-x-map ()
     "Configure the `C-x' keymap."
-    (require 'ol)
- ;  (require 'magit)
-    (require 'consult)
-    (require 'ace-window)
-    (require 'flymake)
-    (require 'eww)
-    (require 'wgrep)
-    (require 'transient)
     (require 'rg)
     (keymap-set ctl-x-map "b" #'consult-buffer)
     (keymap-set ctl-x-4-map "b" #'consult-buffer-other-window)
@@ -847,9 +815,7 @@ For further information about Elisp headers, see [[info:elisp#Library
 :END:
 
 #+begin_src emacs-lisp
-  (defun esy/setup-elfeed ()
-    "Setup `elfeed'."
-    (require 'elfeed)
+  (with-eval-after-load 'elfeed
     (setq elfeed-feeds
           '("https://lwn.net/headlines/rss"
             "https://reddit.com/r/prolog/.rss"
@@ -858,8 +824,6 @@ For further information about Elisp headers, see [[info:elisp#Library
             "https://xkcd.com/rss.xml"
             "https://hnrss.org/newest?points=50"
             "https://planet.emacslife.com/atom.xml")))
-
-  (add-hook 'after-init-hook #'esy/setup-elfeed)
 #+end_src
 
 ** eww
@@ -945,7 +909,6 @@ does in the shell.
     (require 'orderless)
     (require 'all-the-icons)
     (require 'all-the-icons-completion)
-    (require 'hide-mode-line)
     (setq corfu-cycle t
           corfu-auto t
           read-extended-command-predicate #'command-completion-default-include-p
@@ -968,7 +931,10 @@ does in the shell.
     (add-to-list 'completion-at-point-functions #'cape-file)
     (add-to-list 'completion-at-point-functions #'cape-dabbrev)
     (add-hook 'marginalia-mode-hook #'all-the-icons-completion-marginalia-setup)
-    (add-hook 'completion-list-mode-hook #'hide-mode-line-mode))
+    (add-to-list 'display-buffer-alist
+                 '("*Completions*"
+                   (display-buffer-reuse-window display-buffer-at-bottom)
+                   (window-parameters . ((mode-line-format . none))))))
 
   (add-hook 'after-init-hook #'esy/setup-completions)
 #+end_src