]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update Emacs configuration
authorEshel Yaron <me@eshelyaron.com>
Thu, 6 Jul 2023 07:35:52 +0000 (10:35 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 6 Jul 2023 07:35:52 +0000 (10:35 +0300)
.emacs.d/init.el

index daa1c23f66534cae2f374799014a867735d2b034..184350691e2644b406fe5b3d06c9b53738ad34b8 100644 (file)
                       ("nongnu" . "https://elpa.nongnu.org/nongnu-devel/"))
    ;; select some packages to install
    package-selected-packages '(
-                               all-the-icons
-                               all-the-icons-completion
-                               all-the-icons-dired
-                               all-the-icons-gnus
-                               ;; auctex
                                avy
                                bbdb
                                corfu
                                sweeprolog
                                terraform-mode
                                vterm
-                               vundo
                                whitespace-cleanup-mode
                                )
    ;; configure Org capture templates
    gnus-inhibit-startup-message t
    ;; set Gnus backends
    gnus-select-method '(nntp "news.gmane.io")
+   gnus-cite-parse-max-size nil
+   gnus-face-1 'bold
+   gnus-face-2 'gnus-cite-1
+   gnus-face-3 'shadow
+   gnus-summary-line-format "%1{%U%R%z%}%B%2{%f%} %3{(%&user-date;, %k)%}:%* %s\n"
+   gnus-simplify-subject-functions '(gnus-simplify-subject-re)
+   gnus-treat-display-smileys nil
    gnus-secondary-select-methods '((nnimap "gmail"
                                            (nnimap-address "imap.gmail.com")
                                            (nnimap-server-port "imaps")
     (interactive (list user-init-file))
     (find-file init))
 
-  (defun esy/eww-target ()
-    (require 'eww)
-    (if (use-region-p)
-        (let ((target (buffer-substring-no-properties (use-region-beginning)
-                                                      (use-region-end))))
-          (add-to-history 'eww-prompt-history target)
-          target)
-      (completing-read "Browse or search: "
-                       eww-prompt-history nil nil nil
-                       'eww-prompt-history
-                       (eww-suggested-uris))))
-
-  (defun esy/eww (target)
-    "Browse or search for TARGET."
-    (interactive (list (esy/eww-target)))
-    (eww target))
-
   (with-eval-after-load 'shell
     (keymap-set shell-mode-map "SPC" #'comint-magic-space))
 
@@ -726,7 +710,6 @@ Interactively, POINT is point and KILL is the prefix argument."
 
 (esy/init-step bindings
   "Bind some keys."
-  (keymap-global-set "C-c w" #'esy/eww)
   (keymap-global-set "C-c c" #'org-capture)
   (keymap-global-set "C-c l" #'org-store-link)
   (keymap-global-set "C-c a" #'org-agenda)
@@ -763,6 +746,7 @@ Interactively, POINT is point and KILL is the prefix argument."
   (keymap-global-set "C-;" #'avy-goto-char-timer)
   (keymap-global-set "C-s-f" #'toggle-frame-fullscreen)
   (keymap-global-set "C-s-l" #'esy/pulse-line)
+  (keymap-global-set "\"" #'insert-pair)
 
   (keymap-set ctl-x-map "b" #'consult-buffer)
   (keymap-set ctl-x-4-map "b" #'consult-buffer-other-window)
@@ -835,7 +819,7 @@ as the initial input for completion, and return that directory."
                nil
                (mapcar (lambda (dir)
                          (when-let ((proj (project-current nil dir)))
-                          (cons (project-name proj) dir)))
+                           (cons (project-name proj) dir)))
                        (project-known-project-roots))))
              (current (project-current))
              (default (and current (project-name current)))
@@ -900,18 +884,12 @@ as the initial input for completion, and return that directory."
     (add-hook 'gnus-group-mode-hook #'gnus-topic-mode)
     (gnus-icalendar-setup)
     (gnus-icalendar-org-setup)
-    (all-the-icons-gnus-setup)
     (bbdb-initialize 'gnus 'mail 'message)))
 
 (esy/init-step dired
   "Configure `dired'."
-  (defun esy/local-all-the-icons-dired-mode ()
-    (unless (file-remote-p default-directory)
-      (all-the-icons-dired-mode)))
-
   (with-eval-after-load 'dired
-    (put 'dired-find-alternate-file 'disabled nil)
-    (add-hook 'dired-mode-hook #'esy/local-all-the-icons-dired-mode)))
+    (put 'dired-find-alternate-file 'disabled nil)))
 
 (esy/init-step tramp
   "Configure remote access via `tramp'."
@@ -972,10 +950,6 @@ as the initial input for completion, and return that directory."
                 (car key-binding)
                 (cdr key-binding)))
 
-  (with-eval-after-load 'marginalia
-    (add-hook 'marginalia-mode-hook
-              #'all-the-icons-completion-marginalia-setup))
-
   (with-eval-after-load 'consult
     (with-eval-after-load 'embark
       (require 'embark-consult))))
@@ -987,7 +961,10 @@ as the initial input for completion, and return that directory."
     (require 'dabbrev)
     (dabbrev--reset-global-variables)
     (setq dabbrev-case-fold-search nil)
-    (dabbrev-capf))
+    (pcase (let ((inhibit-message t))
+             (ignore-errors (dabbrev-capf)))
+      (`(,beg ,end ,table . ,_)
+       (list beg end table :exclusive 'no))))
 
   (add-to-list 'completion-at-point-functions #'esy/dabbrev-capf)
 
@@ -1008,13 +985,6 @@ as the initial input for completion, and return that directory."
     (add-to-list 'lin-mode-hooks 'gnus-group-mode-hook)
     (add-to-list 'lin-mode-hooks 'gnus-server-mode-hook)))
 
-(esy/init-step icons
-  "Configure icons via `all-the-icons'."
-  (with-eval-after-load 'all-the-icons
-    (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 corfu
   "Configure `completion-in-region' UI with `corfu'."
   (let ((original-completion-in-region-function completion-in-region-function))
@@ -1027,11 +997,6 @@ as the initial input for completion, and return that directory."
     (defun esy/margin-formatter (metadata)
       "Format METADATA for `corfu-margin-formatters'."
       (pcase (cdr (assoc 'category metadata))
-        ('file (lambda (string)
-                 (concat (if (string-suffix-p "/" string)
-                             (all-the-icons-icon-for-dir string)
-                           (all-the-icons-icon-for-file string))
-                         " ")))
         ('dabbrev (lambda (_) "… "))))
     (add-to-list 'corfu-margin-formatters #'esy/margin-formatter)
     (corfu-indexed-mode)))
@@ -1222,6 +1187,10 @@ as the initial input for completion, and return that directory."
                         esy/feeds-file))
         (setq elfeed-feeds feeds)))
 
+    (defun esy/update-feeds ()
+      (interactive)
+      (setq elfeed-feeds (esy/feeds)))
+
     (with-eval-after-load 'eww
       (defun esy/eww-add-feed (url keywords)
         (interactive (list (eww-read-alternate-url)