changeset 19: |
ca703415cc62 |
parent: |
f82cb9ded8cf
|
child: |
e74bcdf93260 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Tue, 21 May 2024 22:20:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
add paredit.el |
1 ;;; ellis.el --- Richard's custom-file -*- lexical-binding: t; -*- 5 ;; Author: Richard Westhaver <ellis@rwest.io> 7 ;; This program is free software; you can redistribute it and/or modify 8 ;; it under the terms of the GNU General Public License as published by 9 ;; the Free Software Foundation, either version 3 of the License, or 10 ;; (at your option) any later version. 12 ;; This program is distributed in the hope that it will be useful, 13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 ;; GNU General Public License for more details. 17 ;; You should have received a copy of the GNU General Public License 18 ;; along with this program. If not, see <https://www.gnu.org/licenses/>. 22 ;; This is an example of what you may want to add to your custom 23 ;; config file. Feel free to rip. 28 ;; (require 'slime-cape) 32 (defalias 'make #'compile) 34 (setopt default-theme 'modus-vivendi-tritanopia 35 user-lab-directory (join-paths user-home-directory "lab") 36 company-source-directory (join-paths user-lab-directory "comp")) 38 (unless (display-graphic-p) (setq default-theme 'wheatgrass)) 40 (when (linux-p) (setq dired-listing-switches "-alsh")) 42 (defvar emacs-config-source (join-paths company-source-directory "core/emacs")) 45 (defun edit-emacs-config (&optional src) 46 (interactive (list current-prefix-arg)) 48 (expand-file-name "default.el" emacs-config-source) 52 (keymap-set user-map "e c" #'edit-emacs-config) 53 (keymap-set emacs-lisp-mode-map "C-c C-l" #'load-file) 54 (keymap-set emacs-lisp-mode-map "C-c M-k" #'elisp-byte-compile-file) 57 (add-hook 'common-lisp-mode-hook #'enable-paredit-mode) 58 (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) 62 (defun remember-project () 64 (project-remember-project (project-current)) 67 (defun remember-lab-projects () 69 (project-remember-projects-under user-lab-directory t)) 71 (keymap-global-set "C-<tab>" #'hippie-expand) 72 (keymap-set minibuffer-local-map "C-<tab>" #'hippie-expand) 73 (keymap-set ctl-x-x-map "p p" #'remember-project) 74 (keymap-set ctl-x-x-map "p l" #'remember-lab-projects) 76 (add-hook 'prog-mode-hook #'skt-mode) 77 (add-hook 'org-mode-hook #'skt-mode) 78 (add-hook 'prog-mode-hook #'company-mode) 80 (add-hook 'notmuch-message-mode-hook #'turn-on-orgtbl) 82 (setopt skt-enable-tempo-elements t 84 skt-delete-duplicate-marks t) 86 (keymap-set skt-mode-map "C-c M-b" #'tempo-backward-mark) 87 (keymap-set skt-mode-map "C-c M-f" #'tempo-forward-mark) 88 (keymap-set skt-mode-map "C-c M-a" #'tempo-complete-tag) 90 (use-package markdown-mode :ensure t) 92 (use-package ol-notmuch :ensure t) 98 mail-user-agent 'message-user-agent 99 smtpmail-smtp-server "smtp.gmail.com" 100 message-send-mail-function 'message-smtpmail-send-it 101 smtpmail-debug-info t 102 message-default-mail-headers "Cc: \nBcc: \n" 103 message-kill-buffer-on-exit t 104 user-mail-address "ellis@rwest.io" 105 user-full-name "Richard Westhaver" 106 notmuch-hello-sections '(notmuch-hello-insert-saved-searches 107 notmuch-hello-insert-search 108 notmuch-hello-insert-recent-searches 109 notmuch-hello-insert-alltags) 110 notmuch-show-logo nil 111 notmuch-search-oldest-first nil 112 notmuch-hello-hide-tags '("kill") 113 notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key "i") 114 (:name "unread" :query "tag:unread" :key "u") 115 (:name "new" :query "tag:new" :key "n") 116 (:name "sent" :query "tag:sent" :key "e") 117 (:name "drafts" :query "tag:draft" :key "d") 118 (:name "all mail" :query "*" :key "a") 119 (:name "todo" :query "tag:todo" :key "t"))) 122 (defun notmuch-exec-offlineimap () 123 "execute offlineimap command and tag new mail with notmuch" 125 (start-process-shell-command "offlineimap" 128 (notmuch-refresh-all-buffers)) 130 (defun offlineimap-get-password (host port) 131 (let* ((netrc (netrc-parse (expand-file-name "~/.netrc.gpg"))) 132 (hostentry (netrc-machine netrc host port port))) 133 (when hostentry (netrc-get hostentry "password")))) 135 (defun mark-as-read () 136 "mark message as read." 138 (notmuch-search-tag '("-new" "-unread" "-inbox"))) 140 (defun mark-as-todo () 141 "mark message as todo." 144 (notmuch-search-tag '("-new" "-unread" "-inbox" "+todo"))) 146 (defun mark-as-spam () 147 "mark message as spam." 150 (notmuch-search-tag (list "+spam"))) 152 (keymap-set user-map "e m" #'notmuch) 153 (keymap-set user-map "e M" #'notmuch-exec-offlineimap) 154 (keymap-set notmuch-search-mode-map "S" #'mark-as-spam) 155 (keymap-set notmuch-search-mode-map "R" #'mark-as-read) 156 (keymap-set notmuch-search-mode-map "T" #'mark-as-todo)) 162 '(("http://threesixty360.wordpress.com/feed/" blog math) 163 ("http://www.50ply.com/atom.xml" blog dev) 164 ("http://blog.cryptographyengineering.com/feeds/posts/default" blog) 165 ("http://abstrusegoose.com/feed.xml" comic) 166 ("http://accidental-art.tumblr.com/rss" image math) 167 ("http://researchcenter.paloaltonetworks.com/unit42/feed/" security) 168 ("http://curiousprogrammer.wordpress.com/feed/" blog dev) 169 ("http://feeds.feedburner.com/amazingsuperpowers" comic) 170 ("http://amitp.blogspot.com/feeds/posts/default" blog dev) 171 ("http://pages.cs.wisc.edu/~psilord/blog/rssfeed.rss" blog) 172 ("http://www.anticscomic.com/?feed=rss2" comic) 173 ("http://feeds.feedburner.com/blogspot/TPQSS" blog dev) 174 ("http://techchrunch.com/feeds" tech news) 175 ("https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml" tech news) 176 ("https://static.fsf.org/fsforg/rss/news.xml" tech news) 177 ("https://feeds.npr.org/1001/rss.xml" news) 178 ("https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000664" fin news) 179 ("https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=19854910" tech news) 180 ("https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=100003114" us news) 181 ("http://arxiv.org/rss/cs" cs rnd) 182 ("http://arxiv.org/rss/math" math rnd) 183 ("http://arxiv.org/rss/q-fin" q-fin rnd) 184 ("http://arxiv.org/rss/stat" stat rnd) 185 ("http://arxiv.org/rss/econ" econ rnd) 187 ("http://newartisans.com/rss.xml" dev blog) 189 ;; ("https://lab.rwest.io/comp.atom?feed_token=pHu9qwLkjy4CWJHx9rrJ" comp vc) 190 ("https://www.reddit.com/r/listentothis/.rss" music reddit) 191 ("https://www.ftc.gov/feeds/press-release-consumer-protection.xml" gov ftc) 192 ("https://api2.fcc.gov/edocs/public/api/v1/rss/" gov fcc) 195 (defun yt-dl-it (url) 196 "Downloads the URL in an async shell" 197 (let ((default-directory "~/media/yt")) 198 (async-shell-command (format "youtube-dl %s" url)))) 200 (defun elfeed-youtube-dl (&optional use-generic-p) 203 (let ((entries (elfeed-search-selected))) 204 (cl-loop for entry in entries 205 do (elfeed-untag entry 'unread) 206 when (elfeed-entry-link entry) 208 (mapc #'elfeed-search-update-entry entries) 209 (unless (use-region-p) (forward-line)))) 211 (keymap-set elfeed-search-mode-map "d" 'elfeed-youtube-dl) 212 (keymap-set user-map "e f" #'elfeed) 213 (keymap-set user-map "e F" #'elfeed-update)) 215 (use-package org-mime :ensure t) 217 (use-package sh-script 218 :hook (sh-mode . flymake-mode)) 224 (tempo-define-template 227 "#+AUTHOR: " user-full-name " <" user-mail-address ">" n>) 229 "Insert a readme.org file template.") 230 (tempo-define-template "org:src" 231 '("#+begin_src " p n> 235 (keymap-set user-map "t" #'org-todo) 237 ;; populate org-babel 238 (org-babel-do-load-languages 239 ;; TODO 2021-10-24: bqn, apl, k 240 'org-babel-load-languages '((shell . t) 254 (setq erc-format-nick-function 'erc-format-@nick) 259 (erc-tls :server "irc.libera.chat" :port 6697 260 :client-certificate '("/mnt/y/data/private/krypt/libera.pem")) 261 (setq erc-autojoin-channels-alist '(("irc.libera.chat" "#emacs") 262 ("irc.libera.chat" "#linux") 263 ("irc.libera.chat" "#rust") 264 ("irc.libera.chat" "#btrfs") 265 ("irc.libera.chat" "#lisp") 266 ("irc.libera.chat" "#sbcl") 267 ("irc.oftc.net" "#llvm")))) 270 (defun refresh-tags () 271 "Refresh TAGS database in `user-emacs-directory'." 273 (let ((default-directory user-emacs-directory)) 278 ~/comp/core/emacs/*.el \\ 279 ~/comp/core/emacs/lib/*.el \\ 282 (unless (string-equal "hyde" system-name) 283 (add-hook 'dired-mode-hook #'all-the-icons-dired-mode) 284 (add-hook 'ibuffer-mode-hook #'all-the-icons-ibuffer-mode)) 287 ;;; ellis.el ends here