From 131781cf826e1e960dc04da5c43da16a9c31ce21 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:05:46 -0500 Subject: Message when toggling lexical-binding --- init.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index dc81fc9..5b5d575 100644 --- a/init.el +++ b/init.el @@ -408,7 +408,9 @@ In short, DO NOT USE THIS FUNCTION!!!" (:bind "b" (defun acdw/toggle-lexical-binding () "Toggle `lexical-binding' in the current buffer." (interactive) - (setq lexical-binding (not lexical-binding))))) + (setq lexical-binding (not lexical-binding)) + (message "Lexical-binding is %s" + (if lexical-binding "on." "off."))))) (:with-map case-map -- cgit 1.4.1-21-gabe81 From c37e3ec08268372552d959b5bff1a9f485a668db Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:06:13 -0500 Subject: Require define-repeat-map from the right place --- init.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 5b5d575..dc57fcd 100644 --- a/init.el +++ b/init.el @@ -1263,10 +1263,14 @@ specific to most general, they are these: (crux-reopen-as-root-mode +1)) (setup (:straight-if (define-repeat-map - :host nil - :repo "https://tildegit.org/acdw/define-repeat-map.el") + :host nil + :repo "https://tildegit.org/acdw/define-repeat-map.el") (acdw/system :home)) + (require 'define-repeat-map ; just for me + (acdw/dir + "straight/build/define-repeat-map/define-repeat-map.el")) + (defun acdw/other-window-or-switch-buffer-backward () (interactive) (setq repeat-map 'other-window-repeat-map) -- cgit 1.4.1-21-gabe81 From 9b8d95e894c08bce37b105c187b9cfdfb81afec0 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:06:44 -0500 Subject: Add dogears let's try this again! --- init.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.el b/init.el index dc57fcd..b37202a 100644 --- a/init.el +++ b/init.el @@ -1333,6 +1333,17 @@ specific to most general, they are these: (:with-map lookup-map (:bind "d" #'dictionary-search))) +(setup (:straight (dogears + :host github + :repo "alphapapa/dogears.el" + :files (:defaults + (:exclude "helm-dogears.el")))) + (:option (append savehist-additional-variables) 'dogears-list) + (:global "M-g d" dogears-go + "M-g M-b" dogears-back + "M-g M-f" dogears-forward) + (dogears-mode +1)) + (setup (:straight edit-indirect)) ;; requires extension: -- cgit 1.4.1-21-gabe81 From edc4672f8287c625b88962adfdb211ec05fc1987 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:06:57 -0500 Subject: Default to text-mode with edit-server --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index b37202a..46cba35 100644 --- a/init.el +++ b/init.el @@ -1358,7 +1358,8 @@ specific to most general, they are these: "tildes.net")) 'markdown-mode) (cons (rx "github.com") - 'gfm-mode))) + 'gfm-mode) + (cons "." 'text-mode))) (:advise edit-server-make-frame :before (defun edit-server@set-a-variable (&rest _) -- cgit 1.4.1-21-gabe81 From 8abe4fa3bc3b5158850b263dbe89ae1dd5dd0b3b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:07:12 -0500 Subject: Add tags to elfeed-protocol feeds --- init.el | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 46cba35..ddbc5cf 100644 --- a/init.el +++ b/init.el @@ -1373,11 +1373,27 @@ specific to most general, they are these: (setup (:straight elfeed elfeed-protocol) (:option elfeed-use-curl t + elfeed-curl-extra-arguments '("--insecure") elfeed-feeds `(("fever+https://acdw@mf.acdw.net" :api-url "https://mf.acdw.net/fever/" :password ,(acdw/make-password-fetcher - :host "mf.acdw.net")))) - + :host "mf.acdw.net") + :autotags ; do I want to use elfeed-org ? + '(("r/emacs" reddit social emacs) + ("protesilaos.com/codelog.xml" emacs) + ("tildes.net" social) + ("catandgirl.com" comics) + ("qwantz.com" comics) + ("emacsninja.com" emacs) + ("falseknees.com" comics) + ("emacslife.com" emacs) + ("lisp.org" lisp programming) + ("scheme.org" scheme programming) + ("smbc-comics.com" comics) + ("youtube.com" video) + ("tilde.news" social) + ("xkcd.com" comics))))) + (elfeed-set-timeout 3600) (elfeed-protocol-enable) (:advise elfeed :after (defun elfeed@protocol-update (&rest _) -- cgit 1.4.1-21-gabe81 From 0e8ea745fc80b8605064023195f6470ec919fd35 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:07:50 -0500 Subject: Move stuff around --- init.el | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/init.el b/init.el index ddbc5cf..69dc918 100644 --- a/init.el +++ b/init.el @@ -1541,15 +1541,13 @@ specific to most general, they are these: (:option flyspell-correct-interface #'flyspell-correct-completing-read flyspell-correct--cr-key ";") - (defun acdw/flyspell-correct-f7 () - "Run a full spell correction on the current buffer." - (interactive) - (save-mark-and-excursion - (flyspell-correct-move 0 :forward :rapid))) - (:with-feature flyspell (:bind "C-." #'flyspell-correct-wrapper - "" #'acdw/flyspell-correct-f7) + "" (defun acdw/flyspell-correct-f7 () + "Run a full spell correction on the current buffer." + (interactive) + (save-mark-and-excursion + (flyspell-correct-move 0 :forward :rapid)))) (:unbind "C-;" "C-," "C-." "C-M-i"))) (setup (:straight-if forge @@ -1602,11 +1600,9 @@ specific to most general, they are these: (with-eval-after-load 'elpher (require 'gemini-write))) -(setup (:straight gitattributes-mode)) - -(setup (:straight gitconfig-mode)) - -(setup (:straight gitignore-mode)) +(setup (:straight gitattributes-mode + gitconfig-mode + gitignore-mode)) (setup (:straight helpful) (:require-after 3) @@ -1981,8 +1977,10 @@ browser defined in `browse-url-secondary-browser-function'." (if transform (substring cand - (next-single-property-change 0 'consult-org--buffer cand)) - (let ((m (car (get-text-property 0 'consult-org--heading cand)))) + (next-single-property-change + 0 'consult-org--buffer cand)) + (let ((m (car (get-text-property + 0 'consult-org--heading cand)))) (if (member m org-clock-history) "*Recent*" (buffer-name (marker-buffer m)))))))) @@ -2011,11 +2009,12 @@ the default is \"/\"." (lambda (s) (replace-regexp-in-string "[ \t]+\\'" "" s)) (cl-loop for head in path for n from 0 - collect (el-patch-swap - (org-add-props - head nil 'face - (nth (% n org-n-level-faces) org-level-faces)) - head)) + collect + (el-patch-swap + (org-add-props + head nil 'face + (nth (% n org-n-level-faces) org-level-faces)) + head)) separator)))) (when (> (length fpath) width) (if (< width 7) @@ -2100,9 +2099,11 @@ the default is \"/\"." (when update-packages (require 'straight-x) (straight-x-pull-all)) - (restart-emacs)))(setup (:straight (shell-command+ - :host nil - :repo "https://git.sr.ht/~pkal/shell-command-plus")) + (restart-emacs))) + +(setup (:straight (shell-command+ + :host nil + :repo "https://git.sr.ht/~pkal/shell-command-plus")) (:option shell-command-prompt "$ ") (:with-feature dired (:bind "M-!" shell-command+)) @@ -2381,5 +2382,3 @@ If used with a numeric prefix argument N, N backticks will be inserted." (if prefix (call-interactively #'zzz-to-char) (call-interactively #'zzz-up-to-char))))) - -;;; init.el ends here -- cgit 1.4.1-21-gabe81 From 5beb6dc5819587f805fca34a27c1e7241e5bb48f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:08:00 -0500 Subject: Recenter toots --- init.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 69dc918..a009333 100644 --- a/init.el +++ b/init.el @@ -1766,7 +1766,14 @@ browser defined in `browse-url-secondary-browser-function'." mastodon-tl--enable-relative-timestamps nil) (:hook #'hl-line-mode - #'reading-mode)) + #'reading-mode) + + (defun mastodon-goto-toot@recenter () + "Recenter the current toot." + (recenter -1)) + + (:advise mastodon-tl--goto-next-toot :after #'mastodon-goto-toot@recenter + mastodon-tl--goto-prev-toot :after #'mastodon-goto-toot@recenter)) (setup (:straight (modus-themes :host gitlab -- cgit 1.4.1-21-gabe81 From 07f56f870f538cf408875bc11f7cb091d6d7ff3b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:08:10 -0500 Subject: Remove unused packages --- init.el | 7 ------- 1 file changed, 7 deletions(-) diff --git a/init.el b/init.el index a009333..3948557 100644 --- a/init.el +++ b/init.el @@ -2091,13 +2091,6 @@ the default is \"/\"." (persistent-scratch-mode +1)))) (buffer-list))) -(setup (:straight-if pkgbuild-mode - (executable-find "makepkg")) - (:file-match "PKGBUILD")) - -(setup (:straight powerthesaurus) - (:global "C-c l t" #'powerthesaurus-lookup-word-dwim)) - (setup (:straight restart-emacs) (defun emacs-upgrade (&optional update-packages) "Pull config, upgrade packages, restart Emacs." -- cgit 1.4.1-21-gabe81 From bc902ff38e16ac861e3c4937439f041921fec31f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:08:20 -0500 Subject: Add ytel --- init.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init.el b/init.el index 3948557..0e0be3c 100644 --- a/init.el +++ b/init.el @@ -2373,6 +2373,22 @@ If used with a numeric prefix argument N, N backticks will be inserted." (setup (:straight xr)) +(setup (:straight-if ytel + (executable-find "mpv")) + ;; This might need to be changed depending on whether the instance goes down. + (:option ytel-invidious-api-url "https://invidious.snopyta.org") + (:bind "y" + (defun ytel-watch () ; This could possibly use `browse-url'. + "Stream video at point in mpv." + (interactive) + (let* ((video (ytel-get-current-video)) + (id (ytel-video-id video))) + (start-process "ytel mpv" nil + "mpv" + (concat "https://www.youtube.com/watch?v=" id) + "--ytdl-format=bestvideo[height<=?720]+bestaudio/best") + (message "Starting streaming..."))))) + (setup (:straight zzz-to-char) (:global "M-z" -- cgit 1.4.1-21-gabe81 From f939cc140dc9c27b6d2a9f59fa6a63191fed66c5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:08:30 -0500 Subject: Correct typo --- lisp/acdw-cus-edit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/acdw-cus-edit.el b/lisp/acdw-cus-edit.el index c40f137..89273f0 100644 --- a/lisp/acdw-cus-edit.el +++ b/lisp/acdw-cus-edit.el @@ -28,5 +28,5 @@ 1)) "Show faces and variables in `imenu'.") -(provide 'acdw/cus-edit) +(provide 'acdw-cus-edit) ;;; acdw-cus-edit.el ends here -- cgit 1.4.1-21-gabe81 From 04fbf30e8d8899e5cf8ba7541eb096f52a761723 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:08:41 -0500 Subject: Don't blink cursor in reading-mode --- lisp/acdw-reading.el | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/lisp/acdw-reading.el b/lisp/acdw-reading.el index 26ee5e8..e0a7f74 100644 --- a/lisp/acdw-reading.el +++ b/lisp/acdw-reading.el @@ -11,8 +11,17 @@ ;; - Don't hurt yourself. ;; - Make good choices. +;;; Commentary: + +;; here is my attempt at a reading mode. + ;;; Code: +(require 'olivetti) + +(defvar-local //indicate-empty-lines nil) +(defvar-local //indicate-buffer-boundaries nil) + ;;;###autoload (define-minor-mode reading-mode "A mode for reading." @@ -22,30 +31,37 @@ (if reading-mode (progn ;; turn on ;; settings - (setq-local orig-indicate-empty-lines indicate-empty-lines + (setq-local //indicate-empty-lines indicate-empty-lines indicate-empty-lines nil - orig-indicate-buffer-boundaries indicate-buffer-boundaries + //indicate-buffer-boundaries indicate-buffer-boundaries indicate-buffer-boundaries nil) ;; disable modes - (dolist (mode '(display-fill-column-indicator-mode)) + (dolist (mode '(display-fill-column-indicator-mode + blink-cursor-mode)) (when (fboundp mode) + (set (make-local-variable + (intern (format "//%s" mode))) + (symbol-value mode)) (funcall mode -1))) ;; enable modes (dolist (mode '(olivetti-mode)) (when (fboundp mode) + (set (make-local-variable + (intern (format "//%s" mode))) + (symbol-value mode)) (funcall mode +1)))) ;; turn off - ;; settings - (setq-local indicate-empty-lines orig-indicate-empty-lines - indicate-buffer-boundaries orig-indicate-buffer-boundaries) - ;; enable modes - (dolist (mode '(display-fill-column-indicator-mode)) - (when (fboundp mode) - (funcall mode +1))) - ;; disable modes - (dolist (mode '(olivetti-mode)) + ;; restore settings + (setq-local indicate-empty-lines //indicate-empty-lines + indicate-buffer-boundaries //indicate-buffer-boundaries) + ;; restore modes + (dolist (mode '(display-fill-column-indicator-mode + olivetti-mode + blink-cursor-mode)) (when (fboundp mode) - (funcall mode -1))))) + (funcall mode (if (symbol-value (intern (format "//%s" mode))) + +1 + -1)))))) (provide 'acdw-reading) ;;; acdw-reading.el ends here -- cgit 1.4.1-21-gabe81 From 019f93c3723422d6e11602046ce2d124366e5f72 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:08:55 -0500 Subject: Correct acdw-setup.el Nothing big; just add commentary and require setup. --- lisp/acdw-setup.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/acdw-setup.el b/lisp/acdw-setup.el index cd3807d..e271faa 100644 --- a/lisp/acdw-setup.el +++ b/lisp/acdw-setup.el @@ -11,8 +11,15 @@ ;; - Don't hurt yourself. ;; - Make good choices. +;;; Commentary: + +;; setup.el makes defining local macros for `setup' forms quite simple, at +;; least to my mind. Here are some of the ones I've defined. + ;;; Code: +(require 'setup) + (setup-define :autoload (lambda (func) (if (listp func) -- cgit 1.4.1-21-gabe81 From ee37f38d596aeb96c15bed55bac16c02788786eb Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 27 Sep 2021 23:56:18 -0500 Subject: Ignore a couplea modes with dogears-mode --- init.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.el b/init.el index 0e0be3c..94d3aa5 100644 --- a/init.el +++ b/init.el @@ -1339,6 +1339,10 @@ specific to most general, they are these: :files (:defaults (:exclude "helm-dogears.el")))) (:option (append savehist-additional-variables) 'dogears-list) + (dolist (mode '(magit-status-mode + elfeed-show-mode + elfeed-search-mode)) + (:option (append dogears-ignore-modes) mode)) (:global "M-g d" dogears-go "M-g M-b" dogears-back "M-g M-f" dogears-forward) -- cgit 1.4.1-21-gabe81