From c57cdb05c71669e760076d637e28d20796819d19 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 Sep 2021 18:22:58 -0500 Subject: Update org-mode recipe --- init.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index fff1782..afc3e6e 100644 --- a/init.el +++ b/init.el @@ -1183,8 +1183,8 @@ 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 @@ -1793,8 +1793,19 @@ browser defined in `browse-url-secondary-browser-function'." ((string-suffix-p "~" pattern) `(orderless-flex . ,(substring pattern 0 -1)))))) -(setup (:straight org - org-contrib) +(setup (:straight (org + :type git + :repo "https://git.savannah.gnu.org/git/emacs/org-mode.git" + :local-repo "org" + :depth full + :pre-build (straight-recipes-org-elpa--build) + :build (:not autoloads) + :files (:defaults + "lisp/*.el" + ("etc/styles/" "etc/styles/*"))) + (org-contrib + :type git + :repo "https://git.sr.ht/~bzg/org-contrib")) (:also-load acdw-org) (require 'chd nil 'noerror) (:option org-adapt-indentation nil -- cgit 1.4.1-21-gabe81 From 4873990a706339cb47e0ec6a2954d2b2e8041b69 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 Sep 2021 18:23:15 -0500 Subject: Fix bug in acdw-reading.el --- lisp/acdw-reading.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/acdw-reading.el b/lisp/acdw-reading.el index 5d43dac..e3d5716 100644 --- a/lisp/acdw-reading.el +++ b/lisp/acdw-reading.el @@ -39,14 +39,16 @@ (when (fboundp mode) (set (make-local-variable (intern (format "//%s" mode))) - (symbol-value mode)) + (and (boundp 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)) + (and (boundp mode) + (symbol-value mode))) (funcall mode +1)))) ;; turn off ;; restore settings -- cgit 1.4.1-21-gabe81 From 012305d5adbe73d3a71d94111c14fe92d73a3288 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 Sep 2021 23:16:30 -0500 Subject: Add #emacsconf-org to list of autojoined channels --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index afc3e6e..a9377d9 100644 --- a/init.el +++ b/init.el @@ -1009,7 +1009,8 @@ specific to most general, they are these: circe-network-inhibit-autoconnect '("Pissnet" "Twitch IRC") circe-network-options `(("Libera Chat" - :channels ("#emacs" "#systemcrafters" "##webpals") + :channels ("#emacs" "#systemcrafters" "##webpals" + "#emacsconf-org") :sasl-username ,circe-default-nick :sasl-password ,(acdw/make-password-fetcher :host "libera.chat")) -- cgit 1.4.1-21-gabe81 From b7b43e326a356e66aa603d989c5b3df6c1e0b0b5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 Sep 2021 23:16:51 -0500 Subject: Hook more things into circe --- init.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index a9377d9..62d46f8 100644 --- a/init.el +++ b/init.el @@ -1057,7 +1057,8 @@ specific to most general, they are these: #'enable-circe-color-nicks ;; #'enable-circe-display-images #'enable-circe-new-day-notifier - #'circe-chat@set-prompt)) + #'circe-chat@set-prompt + #'topsy-mode)) (autoload 'circe-nick-color-reset "circe-color-nicks") (add-hook 'modus-themes-after-load-theme-hook @@ -1065,13 +1066,16 @@ specific to most general, they are these: (:with-mode lui-mode (:option lui-fill-column (+ fill-column acdw-irc/left-margin) - lui-fill-type (repeat-string acdw-irc/left-margin " ") + lui-fill-type nil ;;(repeat-string acdw-irc/left-margin " ") lui-time-stamp-position 'right-margin lui-time-stamp-format "%H:%M" lui-track-behavior 'before-switch-to-buffer lui-track-indicator 'fringe lui-fill-remove-face-from-newline nil) + (:hook #'visual-fill-column-mode + #'visual-line-mode) + (:local-set fringes-outside-margins t right-margin-width 5 scroll-margin 0 -- cgit 1.4.1-21-gabe81 From bc4f54512badf8e5e2675967f3138620aaa3aa0a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 Sep 2021 23:17:08 -0500 Subject: Add visual-fill-column --- init.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.el b/init.el index 62d46f8..5cd1c8d 100644 --- a/init.el +++ b/init.el @@ -1741,6 +1741,17 @@ browser defined in `browse-url-secondary-browser-function'." indicate-buffer-boundaries nil) (acdw/setup-fringes))))) +(setup (:straight visual-fill-column) + (:option visual-fill-column-width (+ fill-column 4) + visual-fill-column-center-text t + (append reading-modes) '(visual-fill-column-mode . +1)) + (:hook (defun visual-fill-column@setup () + (if visual-fill-column-mode + (setq-local indicate-empty-lines nil + indicate-buffer-boundaries nil) + (acdw/setup-fringes)))) + (:advise text-scale-adjust :after #'visual-fill-column-adjust)) + (setup (:straight (orderless :host github :repo "oantolin/orderless")) -- cgit 1.4.1-21-gabe81 From 8c14455783a84941616001e1b08e12baeb405a12 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 Sep 2021 23:17:21 -0500 Subject: Remove custom bindings for winum The defaults are fine --- init.el | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/init.el b/init.el index 5cd1c8d..366f0f1 100644 --- a/init.el +++ b/init.el @@ -2307,24 +2307,6 @@ If used with a numeric prefix argument N, N backticks will be inserted." winum-ignored-buffers '(" *which-key*") winum-format " %s") - (when-unfocused winum-map-keys - (defvar winum--keys-mapped nil - "Whether `winum' keys have been mapped already.") - (when (and (not winum--keys-mapped) - (display-graphic-p)) - (:with-map winum-keymap - (:bind "M-0" #'winum-select-window-0-or-10 - "M-1" #'winum-select-window-1 - "M-2" #'winum-select-window-2 - "M-3" #'winum-select-window-3 - "M-4" #'winum-select-window-4 - "M-5" #'winum-select-window-5 - "M-6" #'winum-select-window-6 - "M-7" #'winum-select-window-7 - "M-8" #'winum-select-window-8 - "M-9" #'winum-select-window-9)) - (setq winum--keys-mapped t))) - (winum-mode +1)) (setup (:straight xr)) -- cgit 1.4.1-21-gabe81 From 2c93878756d6e0c83853195a192ef6b80894c59f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 Sep 2021 23:17:41 -0500 Subject: Re-write acdw-reading.el --- lisp/acdw-reading.el | 105 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 36 deletions(-) diff --git a/lisp/acdw-reading.el b/lisp/acdw-reading.el index e3d5716..ff4f0c2 100644 --- a/lisp/acdw-reading.el +++ b/lisp/acdw-reading.el @@ -17,8 +17,60 @@ ;;; Code: -(defvar-local //indicate-empty-lines nil) -(defvar-local //indicate-buffer-boundaries nil) +;;; Customizations + +(defgroup reading nil + "Group for Reading mode customizations." + :prefix "reading-" + :group 'convenience) ; i need to figure this out + +(defcustom reading-vars '((indicate-empty-lines . nil) + (indicate-buffer-boundaries . nil)) + "Alist of variables to set in function `reading-mode'. +The car of each cell is the variable name, and the cdr is the +value to set it to." + :type '(alist :key-type variable + :value-type sexp)) + +(defcustom reading-modes '((display-fill-column-indicator-mode . -1) + (blink-cursor-mode . -1)) + "Alist of modes to set in function `reading-mode'. +The car of each cell is the function name, and the cdr is the +value to call it with." + :type '(alist :key-type function + :value-type sexp)) + +;;; Internal + +(defvar reading--remembered-template "reading--remembered-%s-value" + "The template passed to `format' for remembered modes and variables.") + +(defun reading--remember (things func) + "Apply FUNC to THINGS, remembering their previous value for later." + (declare (indent 1)) + (unless (listp things) + (setq things (list things))) + (dolist (thing things) + (set (make-local-variable + (intern (format reading--remembered-template thing))) + (and (boundp thing) + (symbol-value thing))) + (funcall func thing))) + +(defun reading--recall (things func) + "Recall previously remembered THINGS by applying FUNC to them. +FUNC should be a function with the signature (THING REMEMBERED-SETTING)." + (declare (indent 1)) + (unless (listp things) + (setq things (list things))) + (dolist (thing things) + (with-demoted-errors "reading--recall: %S" + (let ((value (symbol-value + (intern + (format reading--remembered-template thing))))) + (funcall func thing value))))) + +;;; Mode ;;;###autoload (define-minor-mode reading-mode @@ -27,41 +79,22 @@ :lighter " Read" :keymap (make-sparse-keymap) (if reading-mode - (progn ;; turn on - ;; settings - (setq-local //indicate-empty-lines indicate-empty-lines - indicate-empty-lines nil - //indicate-buffer-boundaries indicate-buffer-boundaries - indicate-buffer-boundaries nil) - ;; disable modes - (dolist (mode '(display-fill-column-indicator-mode - blink-cursor-mode)) - (when (fboundp mode) - (set (make-local-variable - (intern (format "//%s" mode))) - (and (boundp mode) - (symbol-value mode))) - (funcall mode -1))) - ;; enable modes - (dolist (mode '(olivetti-mode)) - (when (fboundp mode) - (set (make-local-variable - (intern (format "//%s" mode))) - (and (boundp mode) - (symbol-value mode))) - (funcall mode +1)))) + ;; turn on + (progn + (reading--remember (mapcar #'car reading-vars) + (lambda (var) + (set (make-local-variable var) + (cdr (assoc var reading-vars))))) + (reading--remember (mapcar #'car reading-modes) + (lambda (mode) + (funcall mode (cdr (assoc mode reading-modes)))))) ;; turn off - ;; 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 (if (symbol-value (intern (format "//%s" mode))) - +1 - -1)))))) + (reading--recall (mapcar #'car reading-vars) + (lambda (var orig-val) + (set (make-local-variable var) orig-val))) + (reading--recall (mapcar #'car reading-modes) + (lambda (mode orig-setting) + (funcall mode (if orig-setting +1 -1)))))) (provide 'acdw-reading) ;;; acdw-reading.el ends here -- cgit 1.4.1-21-gabe81