From 08bdb9d3a2f96319055099f42fed96d3bb3271a7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 11:15:16 -0500 Subject: Fix eshell... I think Eshell's loading order is so confusing --- eshell.el | 25 +++++-------------------- init.el | 6 ++---- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/eshell.el b/eshell.el index 05f90bc..c6078c2 100644 --- a/eshell.el +++ b/eshell.el @@ -3,20 +3,6 @@ ;; Copyright (C) 2021 Case Duckworth ;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> -;; Keywords: - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . ;;; Commentary: @@ -26,6 +12,8 @@ ;;; Code: (require 'setup) +(require 'eshell) +(require 'em-alias) ;;; Environment (setenv "PAGER" "cat") @@ -52,8 +40,8 @@ (setup (:straight eshell-syntax-highlighting) (eshell-syntax-highlighting-global-mode +1)) -(setup (:straight-if fish-completion - (executable-find "fish")) +(setup (:straight-when fish-completion + (executable-find "fish")) (:autoload global-fish-completion-mode) (global-fish-completion-mode +1)) @@ -63,8 +51,5 @@ (when (boundp 'simple-modeline--mode-line) (setq mode-line-format '(:eval simple-modeline--mode-line))) -;;; Tell Emacs our customizations are loaded. -(defvar eshell-customizations-loaded t - "Whether eshell's customizations have been loaded yet.") - +(provide 'eshellrc) ;;; eshell.el ends here diff --git a/init.el b/init.el index 4ad55a9..a1536c5 100644 --- a/init.el +++ b/init.el @@ -446,12 +446,10 @@ (:local-set outline-regexp eshell-prompt-regexp page-delimiter eshell-prompt-regexp) - (:bind "C-d" #'eshell-quit-or-delete-char) - (:hook #'eshell-arg-hist-mode (defun eshell-mode@setup () - (unless (bound-and-true-p eshell-customizations-loaded) - (load (expand-file-name "eshell" user-emacs-directory)))))) + (require 'eshellrc (locate-user-emacs-file "eshell") :noerror) + (:bind "C-d" #'eshell-quit-or-delete-char)))) (setup eww (:also-load acdw-eww) -- cgit 1.4.1-21-gabe81 From d134922c7c5ff3ff9f86cb0c04100bdd5436c754 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 11:16:18 -0500 Subject: Add open-paragraph --- init.el | 2 +- lisp/acdw.el | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index a1536c5..2361107 100644 --- a/init.el +++ b/init.el @@ -1222,7 +1222,7 @@ specific to most general, they are these: (setup (:straight crux) (:global "C-o" #'crux-smart-open-line - "M-o" #'crux-smart-open-line-above + "M-o" #'open-paragraph "C-M-\\" #'crux-cleanup-buffer-or-region "C-x 4 t" #'crux-transpose-windows) diff --git a/lisp/acdw.el b/lisp/acdw.el index 969b6c8..cc73071 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -862,6 +862,23 @@ When called with PREFIX, just kill Emacs without confirmation." (let ((b (get-buffer (if (consp b) (car b) b)))) (member (buffer-local-value 'major-mode b) modes))))) (pop-to-buffer (read-buffer "Buffer: " nil t pred)))) + +;;; BLAH + +(defun open-paragraph () + "Open a paragraph after point. +A paragraph is defined as continguous non-empty lines of text +surrounded by empty lines, so opening a paragraph means to make +three blank lines, then place the point on the second one." + (interactive) + ;; Go to next blank line. This /isn't/ `end-of-paragraph-text' because + ;; that's weird with org, and I'm guessing other modes too. + (while (not (looking-at "^$")) + (forward-line 1)) + (newline) + (delete-blank-lines) + (newline 2) + (previous-line)) (provide 'acdw) ;;; acdw.el ends here -- cgit 1.4.1-21-gabe81 From 240990939285d1f52391c4dafdc6f0787bc6a056 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 11:16:32 -0500 Subject: Stub a function --- lisp/chd.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/chd.el b/lisp/chd.el index 697c134..f7b5dbb 100644 --- a/lisp/chd.el +++ b/lisp/chd.el @@ -40,10 +40,12 @@ (org-back-to-heading) (org-open-at-point))) +(defun chd/click-bits (date) + "Create a new Click Bits org file, or edit the one for DATE." + (error "not implemented")) + ;;; NOTES ;; org-protocol: https://orgmode.org/worg/org-contrib/org-protocol.html ;; the bit i wanna pull from TaskIQ: 'document.getElementById("preview") - - (provide 'chd) ;;; chd.el ends here -- cgit 1.4.1-21-gabe81 From 14e4e5d05025d34165ae39ade6a18cf50b4fdf8d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 11:16:55 -0500 Subject: Fix up org-mode config --- init.el | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/init.el b/init.el index 2361107..5217556 100644 --- a/init.el +++ b/init.el @@ -1914,7 +1914,7 @@ browser defined in `browse-url-secondary-browser-function'." org-clock-clocked-in-display 'mode-line org-clock-frame-title-format (cons '(t org-mode-line-string) (cons " --- " frame-title-format)) - ;;org-clock-string-limit 7 ; gives time and not title + org-clock-string-limit 25 ; gives enough information org-clock-persist t org-confirm-babel-evaluate nil org-cycle-separator-lines 0 @@ -1961,12 +1961,24 @@ browser defined in `browse-url-secondary-browser-function'." (:unbind "C-j" ; org-return-and-maybe-indent "M-j") - (:local-set unfill-fill-function #'org-fill-paragraph) + (:local-set unfill-fill-function #'org-fill-paragraph + wc-count-words-function + (lambda (start end) "Count words stupidly with a limit." + (acdw-org/count-words-stupidly start + end + 999))) (with-eval-after-load 'org-export (:option (append org-export-filter-final-output-functions) #'org-export-remove-zero-width-spaces)) + (:local-hook before-save-hook + (defun org/before-save@fix-blank-lines () + (acdw-org/fix-blank-lines t)) + before-save-hook + (defun org/before-save@align-tags () + (org-align-tags :all))) + (:hook ;; #'variable-pitch-mode ;; (defun org-mode@before-save@fill-buffer () @@ -1978,22 +1990,23 @@ browser defined in `browse-url-secondary-browser-function'." ;; This is super ugly because I need to add a function to ;; `before-save-hook', but only in org-mode buffers. So I make a hook ;; to make a hook. I'm sure there's a better way to do this. - (defun org-mode@fix-blank-lines-on-save () - (add-hook 'before-save-hook - (defun acdw-org/fix-blank-lines-in-buffer () - (acdw-org/fix-blank-lines t)) - 0 :local)) + ;; (defun org-mode@fix-blank-lines-on-save () + ;; (add-hook 'before-save-hook + ;; (defun acdw-org/fix-blank-lines-in-buffer () + ;; (acdw-org/fix-blank-lines t)) + ;; 0 :local)) - (defun org-mode@wc-stupid () - (unless (and wc-mode - (> 0 (+ (or wc-orig-words 0) - (or wc-words-delta 0))))) - (setq-local - wc-count-words-function - (lambda (start end) "Count words stupidly with a limit." - (acdw-org/count-words-stupidly start - end - 999))))) + ;; (defun org-mode@wc-stupid () + ;; (unless (and wc-mode + ;; (> 0 (+ (or wc-orig-words 0) + ;; (or wc-words-delta 0))))) + ;; (setq-local + ;; wc-count-words-function + ;; (lambda (start end) "Count words stupidly with a limit." + ;; (acdw-org/count-words-stupidly start + ;; end + ;; 999)))) + ) (with-eval-after-load 'org (org-clock-persistence-insinuate)) -- cgit 1.4.1-21-gabe81 From 46e1d53222ab07825235aeb9c5f21e2ad90fa545 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 11:17:10 -0500 Subject: Fix bug and add bindings --- init.el | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 5217556..546a05a 100644 --- a/init.el +++ b/init.el @@ -2322,8 +2322,11 @@ the default is \"/\"." (list (propertize " " 'display - '((space :align-to - ,(unless visual-fill-column-mode 0)))) + '((space + :align-to + ,(unless + (bound-and-true-p visual-fill-column-mode) + 0)))) (funcall topsy-fn)))))) (setup (:straight trashed) @@ -2419,7 +2422,15 @@ If used with a numeric prefix argument N, N backticks will be inserted." (setq-local indicate-empty-lines nil indicate-buffer-boundaries nil) (acdw/setup-fringes)))) - (:advise text-scale-adjust :after #'visual-fill-column-adjust)) + (:advise text-scale-adjust :after #'visual-fill-column-adjust) + ;; Fix bindings + (when (bound-and-true-p mouse-wheel-mode) + (with-eval-after-load 'visual-fill-column + (dolist (margin '(right-margin left-margin)) + (dolist (event '(wheel-down wheel-up)) + (define-key visual-fill-column-mode-map + (vector margin event) + #'mwheel-scroll)))))) (setup (:straight visual-regexp) (:global "M-%" #'vr/query-replace)) -- cgit 1.4.1-21-gabe81 From d054567cd1325c680b080a334728e7c6e1a59b7a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 11:17:23 -0500 Subject: Remove circe highlight --- init.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 546a05a..aac4e7c 100644 --- a/init.el +++ b/init.el @@ -1070,8 +1070,9 @@ specific to most general, they are these: (with-eval-after-load 'circe (:face circe-nick-highlight-face ((t (:inherit (modus-themes-hl-line modus-themes-bold)))) - circe-my-message-face - ((t (:inherit (modus-themes-slant)))))) + ;; circe-my-message-face + ;; ((t (:inherit (modus-themes-slant)))) + )) (:bind "C-c C-p" #'circe-command-PART "C-l" #'lui-track-jump-to-indicator -- cgit 1.4.1-21-gabe81 From 577a229bc4e5019a118db2abfd621b5d327479fc Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 11:17:37 -0500 Subject: Un-banish the mouse --- init.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/init.el b/init.el index aac4e7c..a48723b 100644 --- a/init.el +++ b/init.el @@ -678,9 +678,6 @@ specific to most general, they are these: ;; -> mouse-1 /always/ follows link (:option mouse-1-click-follows-link t)) -(setup mouse-avoidance - (mouse-avoidance-mode 'banish)) - (setup page (:option page-delimiter (rx bol (or "\f" ";;;") -- cgit 1.4.1-21-gabe81 From c434a7623d27ce855449fec81a1a8a69fbccdd78 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 16:28:26 -0500 Subject: Add nyan-mode I forked it to improve it! --- init.el | 10 ++++++++++ lisp/acdw-modeline.el | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/init.el b/init.el index 22c06f8..2347ac8 100644 --- a/init.el +++ b/init.el @@ -1822,6 +1822,15 @@ browser defined in `browse-url-secondary-browser-function'." (:option nov-text-width fill-column) (:file-match (rx ".epub" eos))) +(setup (:straight (nyan-mode + :host github :repo "TeMPOraL/nyan-mode" + :fork (:host github :repo "duckwork/nyan-mode") + :files ("nyan-mode.el" "img"))) + (:option nyan-animate-nyancat nil + nyan-bar-length 20 + nyan-minimum-window-width fill-column) + (nyan-mode +1)) + ;; (setup (:straight olivetti) ;; (:option olivetti-body-width (+ fill-column 4) ;; olivetti-minimum-body-width fill-column) @@ -2181,6 +2190,7 @@ the default is \"/\"." acdw-modeline/buffer-name acdw-modeline/vc-branch acdw-modeline/wc + acdw-modeline/nyan-cat acdw-modeline/position ) (;; right acdw-modeline/track diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 573a964..a9020c5 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el @@ -82,6 +82,13 @@ Otherwise, cdr should be a function that takes two points (see `count-words')." (minions-minor-modes-menu))))) 'mouse-face 'mode-line-highlight))) +(defun acdw-modeline/nyan-cat () + "Display the nyan cat from function `nyan-mode' in the mode-line." + (when (and (bound-and-true-p nyan-mode) + (eq (bound-and-true-p actually-selected-window) + (get-buffer-window))) + '(" " (:eval (list (nyan-create)))))) + (defun acdw-modeline/modified () ; modified from `simple-modeline' "Displays a color-coded buffer modification/read-only indicator in the mode-line." -- cgit 1.4.1-21-gabe81 From cbb2664667aab148868e3f20532d4823fe5e8a44 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 16:28:57 -0500 Subject: Change pulse-line to pulse-line-current-window It doesn't currently work, but maybe will be easier to change when I'm ready... --- init.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/init.el b/init.el index 2347ac8..bafbc0b 100644 --- a/init.el +++ b/init.el @@ -723,16 +723,21 @@ specific to most general, they are these: pulse-delay 0.5 pulse-iterations 1) - (defun pulse-line (&rest _) - "Pulse the current line." - (pulse-momentary-highlight-one-line (point))) + ;; XXX: this doesn't work yet. I only want to pulse the line in the active + ;; window, so when I have the same buffer viewed in multiple windows I can + ;; still see where my cursor is. To see the issue, C-x 2 then C-x o a few + ;; times. + (defun pulse-line-current-window (&rest _) + "Pulse the current line, but only if this window is active." + (pulse-momentary-highlight-one-line (window-point (selected-window)))) (dolist (func '(scroll-up-command scroll-down-command - recenter-top-bottom other-window + recenter-top-bottom + other-window switch-to-buffer redraw-frame)) - (advice-add func :after #'pulse-line))) + (advice-add func :after #'pulse-line-current-window))) (setup re-builder (require 'acdw-re) -- cgit 1.4.1-21-gabe81 From 2ecdd95e5deeb574640f6f20707995c326fa2e35 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 16:29:38 -0500 Subject: Add actually-selected-window --- init.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.el b/init.el index bafbc0b..ee4c959 100644 --- a/init.el +++ b/init.el @@ -969,6 +969,11 @@ specific to most general, they are these: :repo "willvaughn/emacs-0x0")) (:option 0x0-default-server 'ttm)) +(setup (:straight (actually-selected-window + :host github + :repo "duckwork/actually-selected-window.el")) + (actually-selected-window-mode +1)) + (setup (:straight-when affe (and (or (executable-find "fd") (executable-find "find")) -- cgit 1.4.1-21-gabe81 From f17abf3a098920cd23bdbb8c0cc4d16116443f54 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 16:29:55 -0500 Subject: Add system-packages --- init.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/init.el b/init.el index ee4c959..3759b59 100644 --- a/init.el +++ b/init.el @@ -2328,6 +2328,18 @@ the default is \"/\"." (auto-save-visited-mode -1) (super-save-mode +1)) +(setup (:straight-when system-packages + (seq-some #'executable-find + ;; I can't use `system-packages-supported-package-managers' + ;; because, well, the package isn't installed yet. So + ;; ... update this list if any package managers are added. + '("guix" "nix" + "brew" "macports" + "pacman" "emerge" + "zypper" "dnf" + "apt" "aptitude" + "xbps")))) + (setup (:straight-when systemd (executable-find "systemd"))) -- cgit 1.4.1-21-gabe81 From 26fab554bc1d5152587758abf26ec9d82e600f12 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 16:30:25 -0500 Subject: Change straight-if to straight-when Missed one! --- init.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.el b/init.el index 3759b59..e8c3f04 100644 --- a/init.el +++ b/init.el @@ -1425,11 +1425,11 @@ specific to most general, they are these: ;; (t (apply fn url args)))) ) -(setup (:straight-if emacs-everywhere - (and (executable-find "xclip") - (executable-find "xdotool") - (executable-find "xprop") - (executable-find "xwininfo")))) +(setup (:straight-when emacs-everywhere + (and (executable-find "xclip") + (executable-find "xdotool") + (executable-find "xprop") + (executable-find "xwininfo")))) (setup (:straight (embark ; gotta git that fresh fresh :host github -- cgit 1.4.1-21-gabe81 From ee64ffc41f58a7827a77e9a18074084a90ec31b5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 16:50:20 -0500 Subject: Un-customize the message-header face --- init.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/init.el b/init.el index e8c3f04..8b5265a 100644 --- a/init.el +++ b/init.el @@ -1374,9 +1374,6 @@ specific to most general, they are these: (defun elfeed@protocol-update (&rest _) (elfeed-search-fetch nil))) - (:face message-header-subject - ((t (:height 1.5)))) - (:with-mode elfeed-show-mode (:hook #'reading-mode) -- cgit 1.4.1-21-gabe81 From 8974c4e56c18ea42326de1971e325c0c95657f7e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 16:50:40 -0500 Subject: Ignore DEADLINE and SCHEDULED in acdw-org/count-words-stupidly --- lisp/acdw-org.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 8821b28..3358365 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el @@ -299,11 +299,15 @@ instead of the true count." ;; Ignore headings ((or (org-at-heading-p)) (forward-line)) - ;; Ignore drawers + ;; Ignore property and log drawers ((or (looking-at org-drawer-regexp) (looking-at org-clock-drawer-re)) (search-forward ":END:" nil :noerror) (forward-line)) + ;; Ignore DEADLINE and SCHEDULED keywords + ((or (looking-at org-deadline-regexp) + (looking-at org-scheduled-regexp)) + (forward-line)) ;; Ignore tables ((org-at-table-p) (forward-line)) ;; Ignore hyperlinks, but count the descriptions -- cgit 1.4.1-21-gabe81 From 526d713da1167adcf99350c954e923a98957e540 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 17:04:25 -0500 Subject: Add org-closed-time-regexp to skips when counting words --- lisp/acdw-org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 3358365..05e6409 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el @@ -306,7 +306,8 @@ instead of the true count." (forward-line)) ;; Ignore DEADLINE and SCHEDULED keywords ((or (looking-at org-deadline-regexp) - (looking-at org-scheduled-regexp)) + (looking-at org-scheduled-regexp) + (looking-at org-closed-time-regexp)) (forward-line)) ;; Ignore tables ((org-at-table-p) (forward-line)) -- cgit 1.4.1-21-gabe81 From 95e14142707a2122d6efa1dff70805a7e4c962fb Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 17:29:46 -0500 Subject: Stub a little further with chd/click-bits --- lisp/chd.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/chd.el b/lisp/chd.el index f7b5dbb..b301c8d 100644 --- a/lisp/chd.el +++ b/lisp/chd.el @@ -42,7 +42,11 @@ (defun chd/click-bits (date) "Create a new Click Bits org file, or edit the one for DATE." - (error "not implemented")) + (interactive (list (progn + (require 'org) + (org-read-date)))) + ;; TODO: implement actual logic. + (message "%s" date)) ;;; NOTES ;; org-protocol: https://orgmode.org/worg/org-contrib/org-protocol.html -- cgit 1.4.1-21-gabe81