From 1b12caa6b8404140dd05372d6ab8f791e1cf9438 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 23:57:39 -0600 Subject: [PATCH] Changes --- init.el | 36 ++++++++++++++++++++++++++++++------ lisp/+Info.el | 17 +++++++++++++++++ lisp/+elisp.el | 2 +- lisp/+modeline.el | 3 ++- lisp/+org-capture.el | 5 +++++ 5 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 lisp/+Info.el diff --git a/init.el b/init.el index cd1e674..13284d1 100644 --- a/init.el +++ b/init.el @@ -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) diff --git a/lisp/+Info.el b/lisp/+Info.el new file mode 100644 index 0000000..a3c2fcd --- /dev/null +++ b/lisp/+Info.el @@ -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 diff --git a/lisp/+elisp.el b/lisp/+elisp.el index d2f018a..3eafbf3 100644 --- a/lisp/+elisp.el +++ b/lisp/+elisp.el @@ -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) diff --git a/lisp/+modeline.el b/lisp/+modeline.el index db3deb4..4063d83 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el @@ -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 . "*") diff --git a/lisp/+org-capture.el b/lisp/+org-capture.el index 6968657..ba036bd 100644 --- a/lisp/+org-capture.el +++ b/lisp/+org-capture.el @@ -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'.