]> git.eshelyaron.com Git - dotfiles.git/commitdiff
checkpoint
authorEshel Yaron <me@eshelyaron.com>
Fri, 24 Mar 2023 16:02:38 +0000 (19:02 +0300)
committerEshel Yaron <me@eshelyaron.com>
Fri, 24 Mar 2023 16:02:38 +0000 (19:02 +0300)
.emacs.d/early-init.el
.emacs.d/init.el

index 5f65b8b1b62ae3da51722e6f06defb9f1bc1d440..5bde9bd5523f769333d0b971192c992b0cf0ea2c 100644 (file)
@@ -3,12 +3,17 @@
 
 ;;; Code:
 
-;; (add-to-list 'initial-frame-alist '(fullscreen . fullboth))
-;; (add-to-list 'initial-frame-alist '(alpha-background . 50))
+(defvar esy/init-step-times (list (cons nil (current-time))))
+
+(defun esy/init-step (step)
+  (push (cons step (current-time))
+        esy/init-step-times))
 
 (tool-bar-mode -1)
+(esy/init-step 'tool-bar-mode)
 
 (set-scroll-bar-mode nil)
+(esy/init-step 'scroll-bar-mode)
 
 (provide 'early-init)
 ;;; early-init.el ends here
index 52f4f1e2ce17996196ab4c3ca5780428598cfe7a..167c9e8a86f8d25c4cab4567ed88ec806f970ba7 100644 (file)
@@ -9,6 +9,7 @@
 
 ;;; Code:
 
+(esy/init-step 'init)
 
 ;;;; temporarly increase GC threshold to expedite Emacs startup
 (let ((normal-gc-cons-threshold (* 20 1024 1024))
@@ -19,6 +20,7 @@
   (add-hook 'after-init-hook
             (lambda () (setq gc-cons-threshold normal-gc-cons-threshold
                              mode-line-format normal-mode-line-format))))
+(esy/init-step 'gc)
 
 (setq
  ;; my name
@@ -87,6 +89,7 @@
                              mastodon
                              ob-prolog
                              orderless
+                             org
                              org-modern
                              package-lint
                              paredit
                              sqlformat
                              sweeprolog
                              terraform-mode
-                             typit
                              vterm
                              vundo
                              whitespace-cleanup-mode
  browse-url-generic-program "open"
  ;; set up some feeds for Elfeed
  elfeed-feeds '(
-                "https://ajroach42.com/feed.xml"
+                ("http://node2.feed43.com/7487052648530856.xml" comics scifi)
+                ("https://ajroach42.com/feed.xml")
                 ("https://alexschroeder.ch/wiki/feed/full/" tech)
-                ("https://irreal.org/blog/?feed=rss2" emacs)
                 ("https://amodernist.com/all.atom" emacs)
-                "https://archive.casouri.cc/note/atom.xml"
-                "https://arcology.garden/updates.xml"
+                ("https://archive.casouri.cc/note/atom.xml")
+                ("https://arcology.garden/updates.xml")
+                ("http://www.aaronsw.com/weblog/index.xml" blog tech)
                 ("https://atthis.link/rss.xml" tech)
-                "https://gwern.substack.com/feed"
-                "https://typeclasses.substack.com/feed"
-                ("https://emacsninja.com/feed.atom" emacs)
-                ("https://www.devever.net/~hl/index.feed" tech)
-                ("https://unixsheikh.com/feed.rss" linux)
-                ("https://daniel.haxx.se/blog/feed/" tech)
+                ("https://daily.baty.net/feed/feed.xml" blog tech)
                 ("https://baty.net/feed" tech)
-                "https://betterappsec.com/feed"
-                "https://bitspook.in/blog/feed.xml"
-                "https://blog.acthompson.net/feeds/posts/default"
-                "https://bruda.ca/feed.php"
-                "https://cce.whatthefuck.computer/updates.xml"
-                "https://cdn.jwz.org/blog/feed/"
+                ("https://betterappsec.com/feed")
+                ("https://bitspook.in/blog/feed.xml")
+                ("https://blog.acthompson.net/feeds/posts/default")
+                ("https://bruda.ca/feed.php")
+                ("https://cce.whatthefuck.computer/updates.xml")
+                ("https://cdn.jwz.org/blog/feed/" tech)
                 ("https://cestlaz.github.io/rss.xml" tech)
-                "https://changelog.complete.org/feed"
-                "https://drewdevault.com/blog/index.xml"
-                "https://emacs.dyerdwelling.family/index.xml"
-                "https://erikmcclure.com/blog/index.xml"
-                "https://evanhahn.com/blog/index.xml"
-                "https://fasterthanli.me/index.xml"
-                "https://feeds.buzzsprout.com/2134279.rss"
-                "https://flower.codes/feed.xml"
-                "https://garymarcus.substack.com/feed"
-                "https://herman.bearblog.dev/feed/"
-                "https://jcm.libsyn.com/rss/"
+                ("https://changelog.complete.org/feed")
+                ("https://daniel.haxx.se/blog/feed/" tech)
+                ("https://drewdevault.com/blog/index.xml")
+                ("https://emacs.dyerdwelling.family/index.xml")
+                ("https://emacsninja.com/feed.atom" emacs)
+                ("https://erikmcclure.com/blog/index.xml")
+                ("https://evanhahn.com/blog/index.xml")
+                ("https://fasterthanli.me/index.xml")
+                ("https://feeds.buzzsprout.com/2134279.rss")
+                ("https://flower.codes/feed.xml")
+                ("https://garymarcus.substack.com/feed")
+                ("https://gwern.substack.com/feed" tech blog)
+                ("https://herman.bearblog.dev/feed/")
+                ("https://irreal.org/blog/?feed=rss2" emacs)
+                ("https://jcm.libsyn.com/rss/")
+                ("https://jnd.org/feed" tech philosophy)
+                ("https://kelar.org/~bandali/atom.xml" tech blog)
                 ("https://kitchen-sink.kwakk.info/feed" comics)
                 ("https://lars.ingebrigtsen.no/feed" emacs)
                 ("https://lwn.net/headlines/rss" linux)
                 ("https://maggieappleton.com/rss.xml" design)
-                "https://matklad.github.io/feed.xml"
+                ("https://matklad.github.io/feed.xml")
                 ("https://matt-rickard.com/rss" tech)
-                "https://njoseph.me/shaarli/feed/atom?"
-                "http://node2.feed43.com/7487052648530856.xml"
-                "https://nullprogram.com/feed/"
-                "https://olddeuteronomy.github.io/index.xml"
-                "https://parasurv.neocities.org/rss.xml"
-                "https://phaazon.net/blog/feed"
+                ("https://njoseph.me/shaarli/feed/atom?")
+                ("https://nullprogram.com/feed/" tech)
+                ("https://olddeuteronomy.github.io/index.xml")
+                ("https://parasurv.neocities.org/rss.xml" tech blog)
+                ("https://phaazon.net/blog/feed")
                 ("https://planet.emacslife.com/atom.xml" emacs)
-                "https://ploum.net/atom_en.xml"
-                "https://pouria.dev/rss.xml"
-                "https://project-mage.org/rss.xml"
+                ("https://ploum.net/atom_en.xml")
+                ("https://pod.fossified.com/podcast.rss" tech podcast)
+                ("https://pouria.dev/rss.xml")
+                ("https://project-mage.org/rss.xml")
                 ("https://protesilaos.com/master.xml" emacs philosophy)
                 ("https://reddit.com/r/prolog/.rss" prolog)
+                ("https://risky.biz/rss.xml" tech)
                 ("https://sachachua.com/blog/feed/" emacs)
-                "https://stephanango.com/feed.xml"
-                "https://stppodcast.libsyn.com/rss"
-                "https://takeonrules.com/index.atom"
-                "https://two-wrongs.com/feed"
-                "https://usesthis.com/feed.atom"
-                "https://writer13.neocities.org/rss.xml"
-                "https://www.cs.uni.edu/~wallingf/blog/atom.xml"
-                "https://www.draketo.de/rss-feed.xml"
+                ("https://stephanango.com/feed.xml")
+                ("https://stppodcast.libsyn.com/rss")
+                ("https://takeonrules.com/index.atom")
+                ("https://two-wrongs.com/feed")
+                ("https://typeclasses.substack.com/feed")
+                ("https://unixsheikh.com/feed.rss" linux)
+                ("https://usesthis.com/feed.atom")
+                ("https://writer13.neocities.org/rss.xml")
+                ("https://www.cs.uni.edu/~wallingf/blog/atom.xml")
+                ("https://www.devever.net/~hl/index.feed" tech)
+                ("https://www.draketo.de/rss-feed.xml")
                 ("https://www.evalapply.org/index.xml" emacs)
                 ("https://www.fsf.org/static/fsforg/rss/news.xml" tech)
                 ("https://www.haskellforall.com/feeds/posts/default" tech)
-                "https://www.murilopereira.com/index.xml"
-                "https://www.stilldrinking.org/rss/feed.xml"
+                ("https://www.murilopereira.com/index.xml")
+                ("https://www.stilldrinking.org/rss/feed.xml")
+                ("https://www.theregister.com/headlines.atom" tech)
                 ("https://www.typetheoryforall.com/episodes.mp3.rss" podcast)
                 ("https://xeiaso.net/blog.rss" tech)
+                ("https://xenodium.com/rss.xml" emacs)
                 ("https://xkcd.com/rss.xml" comics tech)
                 )
  ;; don't use bold face for unread Elfeed entries
  ;; persist Git commit message history
  savehist-additional-variables '(log-edit-comment-ring)
  )
+(esy/init-step 'vars)
 
 ;;;; load the modus-vivendi theme
 (require-theme 'modus-themes)
 (load-theme 'modus-vivendi)
+(esy/init-step 'theme)
 
 ;;;; set up the Iosevka font family
 (set-face-attribute 'default nil        :family "Iosevka" :height 130)
 (set-face-attribute 'fixed-pitch nil    :family "Iosevka")
 (set-face-attribute 'variable-pitch nil :family "Iosevka Etoile")
+(esy/init-step 'fonts)
 
 (add-to-list 'load-path (expand-file-name "lisp/" user-emacs-directory))
 
           (propertize "Emacs"           'face 'success)
           (propertize (emacs-init-time) 'face 'error  )))
 
+(esy/init-step 'stuff)
+
 ;;;; set up external packages
 (require 'package)
 
 ;;;; install packages
 (package-install-selected-packages)
 
+(esy/init-step 'packages)
+
 ;;;; enable some built-in tree-sitter modes
 (add-to-list 'auto-mode-alist '("Dockerfile"  . dockerfile-ts-mode))
 (add-to-list 'auto-mode-alist '("\\.ya?ml\\'" . yaml-ts-mode))
 (add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
 (add-hook 'prog-mode-hook #'flyspell-prog-mode)
 (add-hook 'prog-mode-hook #'flymake-mode)
+(esy/init-step 'prog-mode-hooks)
 
 ;;;; bind some keys
 (keymap-global-set "C-c w" #'esy/eww)
 (keymap-set search-map "r" #'rg)
 (keymap-set search-map "l" #'rg-literal)
 (keymap-set search-map "b" #'some-button)
+(esy/init-step 'bindings)
 
 ;;;; unbind some keys
 (dolist (key '("s-a" "s-d" "s-e" "s-f" "s-g" "s-h" "s-j" "s-k" "s-l"
   (add-hook 'dired-mode-hook #'esy/local-all-the-icons-dired-mode))
 
 ;;;; workaround for Bug#62329
-(with-eval-after-load 'compile
-  (require 'tramp-sh))
+;; (with-eval-after-load 'compile
+;;   (require 'tramp-sh))
 
 (with-eval-after-load 'tramp
   (tramp-set-completion-function "ssh" '((tramp-parse-netrc "~/.authinfo.gpg")))
         `(,start ,end completion--file-name-table . (:exclusive no))))))
 
 (add-to-list 'completion-at-point-functions #'esy/file-capf)
+(esy/init-step 'capf)
 
 (require 'use-package)
-
+(esy/init-step 'use-package)
 ;;;; highlight the current line in line-oriented buffers
 (use-package lin
   :config
   (add-to-list 'lin-mode-hooks 'gnus-summary-mode-hook)
   (add-to-list 'lin-mode-hooks 'gnus-group-mode-hook)
   (add-to-list 'lin-mode-hooks 'gnus-server-mode-hook))
+(esy/init-step 'lin)
 
 (use-package all-the-icons
   :config
   (add-to-list 'all-the-icons-extension-icon-alist
                '("pl" all-the-icons-alltheicon "prolog"
                  :height 1.1 :face all-the-icons-lmaroon)))
+(esy/init-step 'icons)
 
 (defun esy/margin-formatter (metadata)
   "Format METADATA for `corfu-margin-formatters'."
 (use-package marginalia
   :config
   (add-hook 'marginalia-mode-hook #'all-the-icons-completion-marginalia-setup))
+(esy/init-step 'marginalia)
 
 ;; enable some global minor modes
 (dolist-with-progress-reporter (mode '(
                                        context-menu-mode
                                        corfu-indexed-mode
                                        display-time-mode
-                                       display-time-mode
+                                       display-battery-mode
                                        global-auto-revert-mode
                                        global-corfu-mode
                                        global-diff-hl-mode
                                        transient-mark-mode
                                        ))
     "Enabling minor modes"
-    (funcall mode))
+  (funcall mode))
+(esy/init-step 'minor-modes)
 
 (emms-minimalistic)
+(esy/init-step 'emms)
 
 ;;;; PDF settings
-(pdf-tools-install t)
-
-(add-hook 'pdf-view-mode-hook #'pdf-view-midnight-minor-mode)
-
-(add-to-list 'revert-without-query "\\.pdf\\'")
-
-(add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode))
+(use-package pdf-tools
+  :mode  ("\\.pdf\\'" . pdf-view-mode)
+  :config
+  (pdf-tools-install :no-query)
+  (add-hook 'pdf-view-mode-hook #'pdf-view-midnight-minor-mode)
+  (add-to-list 'revert-without-query "\\.pdf\\'"))
+(esy/init-step 'pdf)
 
 (with-eval-after-load 'tex
   (add-hook 'TeX-after-compilation-finished-functions
             #'TeX-revert-document-buffer))
+(esy/init-step 'tex)
 
-(use-package vterm
-  :config
+(with-eval-after-load 'vterm
   (add-to-list 'vterm-tramp-shells '("kubernetes" "/bin/bash")))
+;; (use-package vterm
+;;   :config
+;;   (add-to-list 'vterm-tramp-shells '("kubernetes" "/bin/bash")))
+(esy/init-step 'vterm)
 
 (use-package paredit
   :hook lisp-data-mode
   :config
   (keymap-unset paredit-mode-map "M-s" t)
   (keymap-unset paredit-mode-map "M-?" t))
+(esy/init-step 'paredit)
 
 (use-package haskell-mode
   :hook ((haskell-mode . interactive-haskell-mode)
          (haskell-mode . haskell-decl-scan-mode)
          (haskell-mode . haskell-doc-mode)))
+(esy/init-step 'haskell)
 
 (use-package sweeprolog
   :mode ("\\.plt?\\'" . sweeprolog-mode)
   (add-hook 'sweeprolog-top-level-mode-hook #'compilation-shell-minor-mode)
   (with-eval-after-load 'org
     (add-to-list 'org-src-lang-modes '("prolog" . sweeprolog))))
+(esy/init-step 'sweep)
 
-(use-package rg
-  :config
+(with-eval-after-load 'rg
   (add-to-list 'rg-custom-type-aliases '("Prolog" . "*.pl *.plt *.pro *.prolog")))
+;; (use-package rg
+;;   :config
+;;   (add-to-list 'rg-custom-type-aliases '("Prolog" . "*.pl *.plt *.pro *.prolog")))
+(esy/init-step 'rg)
 
 (use-package terraform-mode
   :config
   (setq terraform--resource-name-face font-lock-function-name-face
         terraform--resource-type-face font-lock-type-face))
+(esy/init-step 'terraform)
 
 (with-eval-after-load 'consult
   (with-eval-after-load 'embark
     (require 'embark-consult)))
+(esy/init-step 'embark-consult)
 
 ;;;; compile this file (if changed) when Emacs is killed
 (defun esy/compile-config ()
     (byte-compile-file user-init-file)))
 
 (add-hook 'kill-emacs-hook #'esy/compile-config 10)
+(esy/init-step 'kill-hook)
+
+(let ((last nil))
+  (dolist (step (reverse esy/init-step-times))
+    (message "%s (%f) %s"
+             (format-time-string "%T.%N" (cdr step))
+             (if last
+                 (float-time (time-subtract (cdr step) last))
+               0)
+             (car step))
+    (setq last (cdr step))))
 
 (provide 'init)
 ;;; init.el ends here