This commit is contained in:
Case Duckworth 2022-01-04 23:57:39 -06:00
parent 9661461943
commit 1b12caa6b8
5 changed files with 55 additions and 8 deletions

36
init.el
View File

@ -96,15 +96,27 @@
(setup (:require reading)
(:global "C-c C-r" #'reading-mode))
(setup Info
(:hook #'reading-mode))
(setup abbrev
(:option abbrev-file-name (sync/ "abbrev.el")
save-abbrevs 'silent)
(:hook-into text-mode
circe-chat-mode))
(setup auto-insert
(setf (alist-get '("lisp/.*\\.el\\'" . "+Emacs lisp")
auto-insert-alist nil nil #'equal)
'("" ";;; " (file-name-nondirectory (buffer-file-name))
(make-string (max 2 (- fill-column (current-column) 27)) 32)
"-*- lexical-binding: t; -*-"
'(setq lexical-binding t)
"\n\n;;Copyright (C) " (format-time-string "%Y")
" " (progn user-full-name)
"\n\n;;; Code:"
"\n\n" _
"\n\n(provide '" (file-name-base (buffer-file-name)) ")"
"\n;;; " (file-name-nondirectory (buffer-file-name)) " ends here\n"))
(auto-insert-mode +1))
(setup autorevert
(:option global-auto-revert-non-file-buffers t
auto-revert-verbose nil)
@ -133,7 +145,8 @@
"tildes.net"
"taskiq"
"twitter.com" "nitter.net"
"streamable.com"))
"streamable.com"
"hetzner.cloud"))
(add-to-list '+browse-url-secondary-browser-regexps domain))
;; Set up URL handlers.
(+browse-url-set-handlers
@ -147,7 +160,7 @@
args)))
(cons (rx ; videos
(or "youtube.com" "youtu.be" "yewtu.be"
(seq "." (or "mp4" "gif" "mov" "MOV") eos)))
(seq "." (or "mp4" "gif" "mov" "MOV" "webm") eos)))
(lambda (&rest args)
(apply (if (executable-find "mpv")
#'+browse-url-with-mpv
@ -328,6 +341,13 @@
(ibuffer-auto-mode +1)
(ibuffer-switch-to-saved-filter-groups "default"))))
(setup info
(:also-load +Info)
(:with-mode Info-mode ; -_-
(:hook #'reading-mode)
(:bind "c" #'+Info-copy-current-node-name
"w" #'+Info-copy-current-node-name)))
(setup kmacro
(:also-load +kmacro)
(with-eval-after-load '+kmacro
@ -521,6 +541,10 @@
:repo "duckwork/actually-selected-window.el"))
(actually-selected-window-mode +1))
(setup (:straight adaptive-wrap)
(:with-mode adaptive-wrap-prefix-mode
(:hook-into visual-column-mode)))
(setup (:straight anzu)
(:option anzu-cons-mode-line-p nil)
(:+key [remap query-replace] #'anzu-query-replace-regexp
@ -670,7 +694,7 @@
lui-time-stamp-position 'right-margin
lui-time-stamp-format "[ %H:%M"
lui-track-behavior 'before-switch-to-buffer
lui-track-indicator 'fringe
lui-track-indicator 'bar
lui-fill-remove-face-from-newline nil
lui-formatting-list `((,(+lui-make-formatting-list-rx "*")
1 lui-strong-face)

17
lisp/+Info.el Normal file
View File

@ -0,0 +1,17 @@
;;; +Info.el -*- lexical-binding: t; -*-
;;Copyright (C) 2022 Case Duckworth
;;; Code:
(require 'info)
(defun +Info-copy-current-node-name (&optional arg)
"Put the name of the current Info invocation intothe kill ring.
This is the same as `Info-copy-current-node-name', but with the
arg reversed."
(interactive "P" Info-mode)
(Info-copy-current-node-name (unless arg 0)))
(provide '+Info)
;;; +Info.el ends here

View File

@ -6,7 +6,7 @@
(interactive)
(if (region-active-p)
(eval-region (region-beginning) (region-end))
(eval-buffer)))
(+eval-region@pulse (lambda (_ _) (eval-buffer)) (point-min) (point-max))))
;; Should I move this to `+pulse' ?
(defun +eval-region@pulse (advised beg end &rest args)

View File

@ -91,7 +91,8 @@ This function makes a lambda, so you can throw it straight into
(propertize (+string-truncate (format-mode-line mode-name) 12)
'face 'bold
'keymap mode-line-major-mode-keymap
'help-echo (concat mode-name " mode\nmouse-1: show menu.")
'help-echo (concat (format-mode-line mode-name)
" mode\nmouse-1: show menu.")
'mouse-face 'mode-line-highlight)))
(defcustom +modeline-modified-icon-alist '((ephemeral . "*")

View File

@ -3,6 +3,7 @@
;;; Code:
(require 'cl-lib)
(require 'acdw)
;; We don't require `org-capture' here because I'll have to require this library
;; to init.el /before/ org-capture is fully needed. But I do need to declare
;; `org-capture-templates'.
@ -39,6 +40,10 @@ LIST is a symbol and defaults to `org-capture-templates'."
(set list (sort (symbol-value list) (lambda (a b)
(string< (car a) (car b))))))
(defun +org-capture-sort-after-init (&optional list)
"Sort LIST with `+org-capture-sort' after Emacs init."
(+ensure-after-init #'+org-capture-sort))
;;;###autoload
(defun +org-capture-templates-setf (key value &optional list sort-after)
"Add KEY to LIST, using `setf'.