Weekend, babee

This commit is contained in:
Case Duckworth 2022-01-09 20:52:07 -06:00
parent 9360a54e62
commit b7295426c9
10 changed files with 240 additions and 121 deletions

138
init.el
View File

@ -38,11 +38,12 @@
"C-x o" (lambda () (interactive) (switch-to-buffer nil)) "C-x o" (lambda () (interactive) (switch-to-buffer nil))
"C-x C-o" #'+open-paragraph "C-x C-o" #'+open-paragraph
"C-w" #'+kill-word-backward-or-region "C-w" #'+kill-word-backward-or-region
"C-x C-1" #'delete-other-windows ;; "C-x C-1" #'delete-other-windows
"C-x 2" #'+split-window-below-then ;; "C-x 2" #'+split-window-below-then
"C-x C-2" #'+split-window-below-then ;; "C-x C-2" #'+split-window-below-then
"C-x 3" #'+split-window-right-then ;; "C-x 3" #'+split-window-right-then
"C-x C-3" #'+split-window-right-then) ;; "C-x C-3" #'+split-window-right-then
)
;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults
(global-set-key (kbd "C-h") 'delete-backward-char) (global-set-key (kbd "C-h") 'delete-backward-char)
(keyboard-translate ?\C-h ?\C-?) (keyboard-translate ?\C-h ?\C-?)
@ -58,9 +59,6 @@
(:bind "C-c s" #'+init-sort-then-save) (:bind "C-c s" #'+init-sort-then-save)
(:hook #'+init-add-setup-to-imenu)) (:hook #'+init-add-setup-to-imenu))
(setup (:require +lookup)
(+lookup-mode +1))
(setup (:require auth-source) (setup (:require auth-source)
(:option auth-sources (list (private/ "authinfo")))) (:option auth-sources (list (private/ "authinfo"))))
@ -109,6 +107,9 @@
(:option pulse-flag nil (:option pulse-flag nil
pulse-delay 0.5 pulse-delay 0.5
pulse-iterations 1) pulse-iterations 1)
(dolist (command '(+ace-window-or-switch-buffer
pop-mark pop-globl-mark))
(add-to-list '+pulse-location-commands command))
(+ensure-after-init #'+pulse-location-mode)) (+ensure-after-init #'+pulse-location-mode))
(setup (:require reading) (setup (:require reading)
@ -137,6 +138,15 @@
(:option (:option
browse-url-browser-function #'eww-browse-url browse-url-browser-function #'eww-browse-url
+browse-url-browser-function browse-url-browser-function +browse-url-browser-function browse-url-browser-function
browse-url-generic-program (seq-some #'executable-find
'("firefox"
"chromium"
"chrome"))
browse-url-generic-args (seq-some (lambda (e)
(when (equal (executable-find (car e))
browse-url-generic-program)
(cdr e)))
'(("firefox" "--new-tab")))
browse-url-secondary-browser-function (if (executable-find "firefox") browse-url-secondary-browser-function (if (executable-find "firefox")
#'browse-url-firefox #'browse-url-firefox
#'browse-url-default-browser) #'browse-url-default-browser)
@ -230,7 +240,7 @@
copy move hardlink symlink copy move hardlink symlink
shell touch) shell touch)
dired-dwim-target t) dired-dwim-target t)
(:local-set truncate-lines nil) (:local-set truncate-lines t)
(:bind "<backspace>" #'dired-up-directory (:bind "<backspace>" #'dired-up-directory
"TAB" #'dired-subtree-cycle "TAB" #'dired-subtree-cycle
"i" #'dired-subtree-toggle "i" #'dired-subtree-toggle
@ -475,13 +485,19 @@
(with-eval-after-load 'org (with-eval-after-load 'org
(org-clock-persistence-insinuate) (org-clock-persistence-insinuate)
(org-link-set-parameters "tel" :follow #'+org-tel-open)) (org-link-set-parameters "tel" :follow #'+org-tel-open))
;; Fancy list bullets ;; Extra keywords
(font-lock-add-keywords (font-lock-add-keywords
'org-mode 'org-mode
'(("^ *\\([-]\\) " '(;; Fancy list bullets
("^ *\\([-]\\) "
(0 (compose-region (match-beginning 1) (match-end 1) ""))) (0 (compose-region (match-beginning 1) (match-end 1) "")))
("^ *\\([+]\\) " ("^ *\\([+]\\) "
(0 (compose-region (match-beginning 1) (match-end 1) "")))))) (0 (compose-region (match-beginning 1) (match-end 1) ""))))
(with-eval-after-load 'form-feed
;; Horizontal lines
(font-lock-add-keywords
'org-mode
'(("^-----+" 0 'form-feed--font-lock-face t))))))
(setup org-agenda (setup org-agenda
(:option org-agenda-skip-deadline-if-done t (:option org-agenda-skip-deadline-if-done t
@ -586,9 +602,6 @@
(executable-find "diff")) (executable-find "diff"))
(:require apheleia (:require apheleia
+apheleia) +apheleia)
(setf (alist-get 'indent-region apheleia-formatters) #'+apheleia-indent-region
(alist-get 'emacs-lisp-mode apheleia-mode-alist) 'indent-region
(alist-get 'lisp-interaction-mode apheleia-mode-alist) 'indent-region)
(apheleia-global-mode +1)) (apheleia-global-mode +1))
(setup (:straight avy) (setup (:straight avy)
@ -721,9 +734,15 @@
(advice-add #'circe-command-GQUIT :after #'+circe-gquit@kill-buffer) (advice-add #'circe-command-GQUIT :after #'+circe-gquit@kill-buffer)
(:with-mode circe-chat-mode (:with-mode circe-chat-mode
(:local-set lui-input-function #'+lui-filter)
(:hook #'enable-circe-color-nicks (:hook #'enable-circe-color-nicks
#'enable-circe-new-day-notifier #'enable-circe-new-day-notifier
#'+circe-chat@set-prompt) #'+circe-chat@set-prompt
;; Filters
#'+circe-F/C-mode
;; For some reason `+circe-shorten-url-mode' won't work right out of
;; the gate.
(lambda () (run-with-idle-timer 0.25 nil #'+circe-shorten-url-mode)))
(:bind "C-c C-s" #'circe-command-SLAP)) (:bind "C-c C-s" #'circe-command-SLAP))
(:with-mode lui-mode (:with-mode lui-mode
@ -889,8 +908,7 @@ See also `crux-reopen-as-root-mode'."
(:option dictionary-use-single-buffer t) (:option dictionary-use-single-buffer t)
(autoload 'dictionary-search "dictionary" (autoload 'dictionary-search "dictionary"
"Ask for a word and search it in all dictionaries" t) "Ask for a word and search it in all dictionaries" t)
(:hook #'reading-mode) (:hook #'reading-mode))
(define-key +lookup-mode-map "d" #'dictionary-search))
(setup (:straight (discord (setup (:straight (discord
:host github :host github
@ -918,12 +936,15 @@ See also `crux-reopen-as-root-mode'."
elfeed-search-title-min-width 24 elfeed-search-title-min-width 24
elfeed-search-title-max-width 78 elfeed-search-title-max-width 78
elfeed-show-unique-buffers t elfeed-show-unique-buffers t
elfeed-db-directory (elfeed/ "db/" t)) elfeed-db-directory (elfeed/ "db/" t)
(:+key "C-x w" #'+elfeed) elfeed-log 'debug ; until I can figure out syncing...
)
(:+key "C-x w" #'elfeed)
(:with-mode elfeed-search-mode (:with-mode elfeed-search-mode
(:hook #'hl-line-mode) (:hook #'hl-line-mode)
;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/
(advice-add #'elfeed-search-update--force :after #'elfeed-db-save)) (advice-add #'elfeed-search-update--force :after #'elfeed-db-save)
(advice-add #'elfeed :before #'elfeed-db-load))
(:with-mode elfeed-show-mode (:with-mode elfeed-show-mode
(:bind "SPC" #'+elfeed-scroll-up-command (:bind "SPC" #'+elfeed-scroll-up-command
"S-SPC" #'+elfeed-scroll-down-command) "S-SPC" #'+elfeed-scroll-down-command)
@ -945,14 +966,16 @@ See also `crux-reopen-as-root-mode'."
(setup (:straight elpher)) (setup (:straight elpher))
(setup (:straight embark) (setup (:straight embark)
(:also-load +embark) (:require embark
+embark)
(:option prefix-help-command 'embark-prefix-help-command (:option prefix-help-command 'embark-prefix-help-command
embark-keymap-prompter-key ";") embark-keymap-prompter-key ";")
(:+key "C-." #'embark-act (:+key "C-." #'embark-act
"M-." #'embark-dwim "M-." #'embark-dwim
"<f1> B" #'embark-bindings) "<f1> B" #'embark-bindings)
(:with-map minibuffer-local-map (:with-map minibuffer-local-map
(:bind "C-." #'embark-act)) (:bind "C-." #'embark-act
"M-." #'embark-dwim))
(:with-map embark-file-map (:with-map embark-file-map
(:bind "l" #'vlf))) (:bind "l" #'vlf)))
@ -1059,14 +1082,14 @@ See also `crux-reopen-as-root-mode'."
(:file-match (rx ".rkt" eos) (:file-match (rx ".rkt" eos)
(rx ".scm" eos))) (rx ".scm" eos)))
(setup (:straight god-mode) ;; (setup (:straight god-mode)
(setq god-mode-enable-function-key-translation nil) ;; (setq god-mode-enable-function-key-translation nil)
(:require god-mode ;; (:require god-mode
+god-mode) ;; +god-mode)
(:+key "C-M-g" #'god-mode-all) ;; (:+key "C-M-g" #'god-mode-all)
(:with-mode god-local-mode ;; (:with-mode god-local-mode
(:bind "i" #'+god-mode-insert ;; (:bind "i" #'+god-mode-insert
"a" nil))) ;; "a" nil)))
(setup (:straight helpful) (setup (:straight helpful)
(run-with-idle-timer 0.5 nil (run-with-idle-timer 0.5 nil
@ -1132,17 +1155,9 @@ See also `crux-reopen-as-root-mode'."
(setup (:straight (lin :host gitlab :repo "protesilaos/lin")) (setup (:straight (lin :host gitlab :repo "protesilaos/lin"))
(require 'lin) (require 'lin)
(:hook-into dired-mode (dolist (hook lin-foreign-hooks)
elfeed-search-mode (add-hook hook #'hl-line-mode)
git-rebase-mode (add-hook hook #'lin-mode)))
ibuffer-mode
ledger-report-mode
log-view-mode
magit-log-mode
notmuch-search-mode
notmuch-tree-mode
org-agenda-mode
tabulated-list-mode))
(setup (:straight link-hint) (setup (:straight link-hint)
(:require +link-hint) (:require +link-hint)
@ -1155,6 +1170,11 @@ See also `crux-reopen-as-root-mode'."
"m" #'link-hint-open-multiple-links "m" #'link-hint-open-multiple-links
"M-c" #'link-hint-copy-link "c" #'link-hint-copy-link))) "M-c" #'link-hint-copy-link "c" #'link-hint-copy-link)))
(setup (:straight macrostep)
(:require macrostep)
(:with-mode emacs-lisp-mode
(:bind "C-c e" #'macrostep-expand)))
(setup (:straight marginalia) (setup (:straight marginalia)
(marginalia-mode +1)) (marginalia-mode +1))
@ -1306,8 +1326,10 @@ See also `crux-reopen-as-root-mode'."
:host github :host github
:repo "duckwork/titlecase.el" :repo "duckwork/titlecase.el"
:files ("*"))) :files ("*")))
(:with-map +casing-mode-map (:require titlecase)
(:bind "t" #'titlecase-dwim))) (:with-map +casing-map
(:bind "t" #'titlecase-dwim
"M-t" #'titlecase-dwim)))
(setup (:straight topsy) (setup (:straight topsy)
(:hook-into ;;prog-mode (:hook-into ;;prog-mode
@ -1366,11 +1388,35 @@ See also `crux-reopen-as-root-mode'."
(add-to-list 'native-comp-deferred-compilation-deny-list "vertico")) (add-to-list 'native-comp-deferred-compilation-deny-list "vertico"))
(vertico-mode +1) (vertico-mode +1)
;; Extensions ;; Extensions
(:also-load vertico-directory) (:also-load vertico-directory
vertico-mouse
vertico-unobtrusive
vertico-multiform)
(vertico-mouse-mode +1)
(vertico-multiform-mode +1)
(:option vertico-multiform-commands '((execute-extended-command flat)
(helpful-callable)
(helpful-variable))
;; This is applied /after/ the above, so default is at the end of
;; this alist.
vertico-multiform-categories '((file buffer grid)
(t unobtrusive)))
(dolist (buf-cmd '(consult-find
consult-locate
consult-grep
consult-git-grep
consult-ripgrep
consult-line
consult-line-multi
consult-multi-occur
consult-keep-lines
consult-focus-lines))
(setf (alist-get buf-cmd vertico-multiform-commands) '(buffer)))
(:with-map vertico-map (:with-map vertico-map
(:bind "RET" #'vertico-directory-enter (:bind "RET" #'vertico-directory-enter
"DEL" #'vertico-directory-delete-char "DEL" #'vertico-directory-delete-char
"M-DEL" #'vertico-directory-delete-word)) "M-DEL" #'vertico-directory-delete-word
"TAB" #'+vertico-widen-or-complete))
(add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)) (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy))
(setup (:straight visual-fill-column) (setup (:straight visual-fill-column)

View File

@ -8,9 +8,8 @@
(setq-local indent-line-function (setq-local indent-line-function
(buffer-local-value 'indent-line-function orig)) (buffer-local-value 'indent-line-function orig))
(indent-region (point-min) (indent-region (point-min)
(point-max)) (point-max))
(funcall callback))) (funcall callback)))
(provide '+apheleia) (provide '+apheleia)
;;; +apheleia.el ends here ;;; +apheleia.el ends here

View File

@ -3,7 +3,6 @@
;;; Code: ;;; Code:
(require 'thingatpt) (require 'thingatpt)
(require '+key)
;;;###autoload ;;;###autoload
(defun +upcase-dwim (arg) (defun +upcase-dwim (arg)
@ -61,21 +60,23 @@ Otherwise, it calls `capitalize-word' on the word at point (using
;; Later on, I'll add repeat maps and stuff in here... ;; Later on, I'll add repeat maps and stuff in here...
(defvar +casing-map (let ((map (make-sparse-keymap)))
(define-key map "u" #'+upcase-dwim)
(define-key map (kbd "M-u") #'+upcase-dwim)
(define-key map "l" #'+downcase-dwim)
(define-key map (kbd "M-l") #'+downcase-dwim)
(define-key map "c" #'+capitalize-dwim)
(define-key map (kbd "M-c") #'+capitalize-dwim)
map)
"Keymap for case-related twiddling.")
(define-minor-mode +casing-mode (define-minor-mode +casing-mode
"Enable easy case-twiddling commands." "Enable easy case-twiddling commands."
:lighter " cC" :lighter " cC"
:global t
:keymap (let ((map (make-sparse-keymap))) :keymap (let ((map (make-sparse-keymap)))
(define-key map "u" #'+upcase-dwim) (define-key map (kbd "M-c") +casing-map)
(define-key map (kbd "M-u") #'+upcase-dwim) map))
(define-key map "l" #'+downcase-dwim)
(define-key map (kbd "M-l") #'+downcase-dwim)
(define-key map "c" #'+capitalize-dwim)
(define-key map (kbd "M-c") #'+capitalize-dwim)
map)
(define-key +key-mode-map (kbd "M-c") (when +casing-mode
+casing-mode-map)))
(defvaralias '+casing-map '+casing-mode-map)
(provide '+casing) (provide '+casing)
;;; +casing.el ends here ;;; +casing.el ends here

View File

@ -101,9 +101,11 @@ For entry into `lui-formatting-list'."
(defun +circe-kill-buffer (&rest _) (defun +circe-kill-buffer (&rest _)
"Kill a circe buffer without confirmation, and after a delay." "Kill a circe buffer without confirmation, and after a delay."
(let ((circe-channel-killed-confirmation nil) (let ((circe-channel-killed-confirmation)
(circe-server-killed-confirmation nil)) (circe-server-killed-confirmation))
(run-with-timer 0.25 nil 'kill-buffer))) (when (derived-mode-p 'lui-mode) ; don't spuriously kill
(ignore-errors
(kill-buffer)))))
(defun +circe-quit@kill-buffer (&rest _) (defun +circe-quit@kill-buffer (&rest _)
"ADVICE: kill all buffers of a server after `circe-command-QUIT'." "ADVICE: kill all buffers of a server after `circe-command-QUIT'."
@ -115,9 +117,11 @@ For entry into `lui-formatting-list'."
(defun +circe-gquit@kill-buffer (&rest _) (defun +circe-gquit@kill-buffer (&rest _)
"ADVICE: kill all Circe buffers after `circe-command-GQUIT'." "ADVICE: kill all Circe buffers after `circe-command-GQUIT'."
(dolist (buf (circe-server-buffers)) (let ((circe-channel-killed-confirmation)
(with-current-buffer buf (circe-server-killed-confirmation))
(+circe-quit@kill-buffer)))) (dolist (buf (circe-server-buffers))
(with-current-buffer buf
(+circe-quit@kill-buffer)))))
(defun +circe-quit-all@kill-emacs () (defun +circe-quit-all@kill-emacs ()
"Quit all circe buffers when killing Emacs." "Quit all circe buffers when killing Emacs."
@ -165,28 +169,104 @@ See `circe-network-options' for a list of common options."
(funcall +circe-server-buffer-action buffer)))) (funcall +circe-server-buffer-action buffer))))
;;; Chat commands ;;; Chat commands
;; TODO: Actually ... write these~!?!?!
(defun circe-command-SHORTEN (url)
"Shorten URL using `0x0-shorten-uri'.")
(defun circe-command-SLAP (nick) (defun circe-command-SLAP (nick)
"Slap NICK around a bit with a large trout.") "Slap NICK around a bit with a large trout."
(interactive (list (completing-read "Nick to slap: "
(circe-channel-nicks)
nil t nil)))
(circe-command-ME (format "slaps %s about a bit with a large trout" nick)))
(defun circe-command-POKE (nick) ;;; Filtering functions
"Poke NICK like in the old Facebook days.") ;; Set `lui-input-function' to `+lui-filter', then add the filters you want to
;; `circe-channel-mode-hook'.
;;; Pure idiocy (require 'dash)
(define-minor-mode circe-cappy-hour-mode (defvar +lui-filters nil
"Stack of input functions to apply.
This is an alist with cells of the structure (TAG . FN), so we
can easily remove elements.")
(make-variable-buffer-local '+lui-filters)
(defun +lui-filter (text &optional fn-alist)
(let ((fs (nreverse (purecopy (or fn-alist +lui-filters)))))
(while fs
(setq text (funcall (cdr (pop fs)) text)))
(circe--input text)))
(defmacro +circe-define-filter (name docstring &rest body)
"Define a filter for circe-inputted text."
(declare (doc-string 2)
(indent 1))
(let (plist)
(while (keywordp (car-safe body))
(push (pop body) plist)
(push (pop body) plist))
;; Return value
`(define-minor-mode ,name
,docstring
,@(nreverse plist)
(when (derived-mode-p 'circe-chat-mode)
(if ,name
(push '(,name . (lambda (it) ,@body)) +lui-filters)
(setq +lui-filters
(assoc-delete-all ',name +lui-filters)))))))
;; CAPPY HOUR! (Pure idiocy)
(+circe-define-filter +circe-cappy-hour-mode
"ENABLE CAPPY HOUR IN CIRCE!" "ENABLE CAPPY HOUR IN CIRCE!"
:lighter "CAPPY HOUR" :lighter " CAPPY HOUR"
(when (derived-mode-p 'circe-chat-mode) (upcase it))
(if circe-cappy-hour-mode
(setq-local lui-input-function ;; URL Shortener
(lambda (input) (circe--input (upcase input))))
;; XXX: It'd be better if this were more general, but whatever. (+circe-define-filter +circe-shorten-url-mode
(setq-local lui-input-function #'circe--input)))) "Shorten long urls when chatting."
:lighter " c0x0"
(+circe-0x0-shorten-urls it))
(defvar +circe-0x0-max-length 20
"Maximum length of URLs before using a shortener.")
(defun +circe-0x0-shorten-urls (text)
"Find urls in TEXT and shorten them using `0x0'."
(require '0x0)
(require 'browse-url)
(let ((case-fold-search t))
(replace-regexp-in-string
browse-url-button-regexp
(lambda (match)
(if (> (length match) +circe-0x0-max-length)
(+with-message (format "Shortening URL: %s" match)
(0x0-shorten-uri (0x0--choose-server)
(substring-no-properties match)))
match))
text)))
;; Temperature conversion
(+circe-define-filter +circe-F/C-mode
"Convert degF to degF/degC for international chats."
:lighter " F/C"
(str-F/C it))
(defun fahrenheit-to-celsius (degf)
"Convert DEGF to Celsius."
(round (* (/ 5.0 9.0) (- degf 32))))
(defun celsius-to-fahrenheit (degc)
"Convert DEGC to Fahrenheit."
(round (+ 32 (* (/ 9.0 5.0) degc))))
(defun str-F/C (text)
(replace-regexp-in-string "[0-9.]+[Ff]"
(lambda (match)
(format "%s/%dC" match
(fahrenheit-to-celsius
(string-to-number match))))
text))
(provide '+circe) (provide '+circe)
;;; +circe.el ends here ;;; +circe.el ends here

View File

@ -21,12 +21,5 @@
(scroll-down-command arg) (scroll-down-command arg)
(error (elfeed-show-prev))))) (error (elfeed-show-prev)))))
;; https://babbagefiles.blogspot.com/2017/03/take-elfeed-everywhere-mobile-rss.html
(defun +elfeed ()
"Wrapper to load the elfeed db from disk before opening."
(interactive)
(elfeed-db-load)
(elfeed))
(provide '+elfeed) (provide '+elfeed)
;;; +elfeed.el ends here ;;; +elfeed.el ends here

View File

@ -7,7 +7,6 @@
;;; Code: ;;; Code:
(require 'embark) (require 'embark)
(require 'marginalia)
(embark-define-keymap embark-straight-map (embark-define-keymap embark-straight-map
("u" straight-visit-package-website) ("u" straight-visit-package-website)
@ -22,7 +21,8 @@
(add-to-list 'embark-keymap-alist '(straight . embark-straight-map)) (add-to-list 'embark-keymap-alist '(straight . embark-straight-map))
(add-to-list 'marginalia-prompt-categories '("recipe\\|package" . straight)) (with-eval-after-load 'marginalia
(add-to-list 'marginalia-prompt-categories '("recipe\\|package" . straight)))
(provide '+embark) (provide '+embark)
;;; +embark.el ends here ;;; +embark.el ends here

View File

@ -1,26 +0,0 @@
;;; +lookup.el -*- lexical-binding: t; -*-
;;; Commentary:
;; I look up a lot of things in Emacs. Let's bind them all to an easy-to-use
;; keymap.
;;; Code:
(require '+key)
(define-minor-mode +lookup-mode
"A mode for easily looking things up."
:lighter " l^"
:keymap (let ((map (make-sparse-keymap)))
(define-key map "f" #'find-function)
(define-key map "l" #'find-library)
(define-key map "v" #'find-variable)
map)
(define-key +key-mode-map (kbd "C-c l") (when +lookup-mode
+lookup-mode-map)))
(defvaralias '+lookup-map '+lookup-mode-map)
(provide '+lookup)
;;; +lookup.el ends here

View File

@ -85,5 +85,21 @@ properly process the variable."
;; Sort after, maybe ;; Sort after, maybe
(when sort-after (+org-capture-sort list)))) (when sort-after (+org-capture-sort list))))
(defun +org-template--ensure-path (keys &optional list)
"Ensure path of keys exists in `org-capture-templates'."
(unless list (setq list 'org-capture-templates))
(when (> (length key) 1)
;; Check for existence of groups.
(let ((expected (cl-loop for i from 1 to (1- (length key))
collect (substring key 0 i) into keys
finally return keys)))
(cl-loop for ek in expected
if (not (+org-capture--get ek (symbol-value list))) do
(setf (+org-capture--get ek (symbol-value list))
(list (format "(Group %s)" ek)))))))
(defun +org-define-capture-template (keys title &rest args)
)
(provide '+org-capture) (provide '+org-capture)
;;; +org-capture.el ends here ;;; +org-capture.el ends here

View File

@ -12,5 +12,13 @@
(unless (eq 1 (abs (- beg-index vertico--index))) (unless (eq 1 (abs (- beg-index vertico--index)))
(ding)))) (ding))))
(defun +vertico-widen-or-complete ()
(interactive)
(if (or vertico-unobtrusive-mode
vertico-flat-mode)
(progn (vertico-unobtrusive-mode -1)
(vertico-flat-mode -1))
(call-interactively #'vertico-insert)))
(provide '+vertico) (provide '+vertico)
;;; +vertico.el ends here ;;; +vertico.el ends here

View File

@ -128,10 +128,12 @@ I keep forgetting how they differ."
(defmacro +with-message (message &rest body) (defmacro +with-message (message &rest body)
"Execute BODY, with MESSAGE. "Execute BODY, with MESSAGE.
If body executes without errors, MESSAGE...Done will be displayed." If body executes without errors, MESSAGE...Done will be displayed."
;; ^ TODO (declare (indent 1))
`(prog1 (progn (message ,(concat message "...")) (let ((msg (gensym)))
,@body) `(let ((,msg ,message))
(message ,(concat message "...Done.")))) (unwind-protect (progn (message "%s..." ,msg)
,@body)
(message "%s... Done." ,msg)))))
(defun +mapc-some-buffers (func &optional predicate) (defun +mapc-some-buffers (func &optional predicate)
"Perform FUNC on all buffers satisfied by PREDICATE. "Perform FUNC on all buffers satisfied by PREDICATE.