From 41ffc15191d335fb3e17b23cd9a463009d289724 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 6 Jun 2021 23:26:28 -0500 Subject: Write function to require private.el --- gnus.el | 2 +- init.el | 2 +- lisp/acdw.el | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gnus.el b/gnus.el index d179937..31a06e0 100644 --- a/gnus.el +++ b/gnus.el @@ -17,7 +17,7 @@ ;;; Code: ;;; Private files -(require 'acdw-private) +(acdw/require-private) ;;; Select Methods (setq gnus-select-method '(nnnil "")) diff --git a/init.el b/init.el index ac830c2..357f7da 100644 --- a/init.el +++ b/init.el @@ -46,7 +46,7 @@ (normal-top-level-add-subdirs-to-load-path)) ;;;; Private stuff -(require 'acdw-private) +(acdw/require-private) ;;;; Utility functions and variables diff --git a/lisp/acdw.el b/lisp/acdw.el index 48e754d..2f878a9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -410,6 +410,10 @@ Prompt only if there are unsaved changes." (custom-set-faces '(fringe ((t (:foreground "dim gray")))))) +(defun acdw/require-private () + "Require `acdw-private', which is in private.el." + (require 'acdw-private "private.el")) + ;;; URL regexp ;; really, I just want to add gemini:// protocol, but I'm going to do some -- cgit 1.4.1-21-gabe81 From ba1f60ed5a3e164df91390c7524d4c313541bbfb Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 6 Jun 2021 23:27:09 -0500 Subject: Change hook for feed list --- gnus.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnus.el b/gnus.el index 31a06e0..4a38733 100644 --- a/gnus.el +++ b/gnus.el @@ -22,7 +22,7 @@ ;;; Select Methods (setq gnus-select-method '(nnnil "")) -(add-hook 'gnus-startup-hook +(add-hook 'gnus-started-hook (defun gnus-startup@feed-setup () (cond ((fboundp #'gnus/init-feed-list) (gnus/init-feed-list)) -- cgit 1.4.1-21-gabe81 From 3a2346e08452699b70a61bf649c4b8b64a93a4ea Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 6 Jun 2021 23:27:22 -0500 Subject: Require erc on connect --- lisp/acdw-erc.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/acdw-erc.el b/lisp/acdw-erc.el index 92ce6db..7517d0e 100644 --- a/lisp/acdw-erc.el +++ b/lisp/acdw-erc.el @@ -66,6 +66,7 @@ If USE-TLS is non-nil, use TLS." (defun erc/connect () "Connect to all the servers in `erc/servers'." (interactive) + (require 'erc) (mapcar #'connect-to-erc erc/servers)) (defun filter-server-buffers () -- cgit 1.4.1-21-gabe81 From a2823598fbac280ab23ea14324fde2c0dae71cd8 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 6 Jun 2021 23:27:50 -0500 Subject: Add acdw-erc/prompt --- lisp/acdw-erc.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lisp/acdw-erc.el b/lisp/acdw-erc.el index 7517d0e..6e06325 100644 --- a/lisp/acdw-erc.el +++ b/lisp/acdw-erc.el @@ -81,6 +81,23 @@ If USE-TLS is non-nil, use TLS." (with-message (format "Killing server buffer: %s" (buffer-name buffer)) (with-current-buffer buffer (erc-quit-server erc/bye-message))))) +(defun acdw-erc/prompt () + "The prompt to show for ERC." + ;; Rewrite s-truncate to avoid dependency. + (let ((name (buffer-name)) + (ellipsis "...") + (len erc-fill-static-center)) + (if (and len (> (length name) (- len 2))) + (format "%s%s>" + (substring name 0 (- len 2 (length ellipsis))) + ellipsis) + (format "%s%s>" (let ((ss) ; Rewrite s-repeat to avoid dependency. + (num (- len 2 (length name)))) + (while (> num 0) + (setq ss (cons " " ss)) + (setq num (1- num))) + (apply #'concat ss)) + name)))) (provide 'acdw-erc) ;;; acdw-erc.el ends here -- cgit 1.4.1-21-gabe81 From a19c83eb11b528cfa59686c816b0e3652770db35 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 6 Jun 2021 23:27:57 -0500 Subject: Force mode line update after quitting server Still not quite working... i think i need to kill all the channel buffers too. --- lisp/acdw-erc.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/acdw-erc.el b/lisp/acdw-erc.el index 6e06325..8cf9734 100644 --- a/lisp/acdw-erc.el +++ b/lisp/acdw-erc.el @@ -80,7 +80,9 @@ If USE-TLS is non-nil, use TLS." (dolist (buffer (filter-server-buffers)) (with-message (format "Killing server buffer: %s" (buffer-name buffer)) (with-current-buffer buffer - (erc-quit-server erc/bye-message))))) + (erc-quit-server erc/bye-message)))) + (force-mode-line-update)) + (defun acdw-erc/prompt () "The prompt to show for ERC." ;; Rewrite s-truncate to avoid dependency. -- cgit 1.4.1-21-gabe81 From 411855b816babb3f641c1ffcdf11d4d12a340b32 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 6 Jun 2021 23:28:25 -0500 Subject: Change ERC config --- init.el | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/init.el b/init.el index 357f7da..73a7c5d 100644 --- a/init.el +++ b/init.el @@ -262,22 +262,29 @@ erc-button-url-regexp browse-url-button-regexp erc-common-server-suffixes '(("tilde.chat\\'" . "~") ("libera.chat\\'" . "LC")) + erc-default-server "irc.tilde.chat" ; fuck freenode. all my friends hate + ; freenode. + erc-fill-function #'erc-fill-static + erc-fill-static-center 14 erc-header-line-face-method #'erc/update-header-line-show-disconnected erc-hide-list '("JOIN" "NICK" "PART" "QUIT" "MODE" "324" "329" "332" "333" "353" "477") erc-interpret-controls-p t erc-interpret-mirc-color t - erc-join-buffer 'buffer + erc-join-buffer 'bury erc-kill-buffer-on-part t erc-kill-queries-on-quit t erc-kill-server-buffer-on-quit t erc-nick "acdw" - erc-prompt (lambda () (concat (buffer-name) ">")) + erc-prompt (lambda () (acdw-erc/prompt)) erc-prompt-for-password nil ; use ~/.authinfo erc/servers (mapcar #'car erc-autojoin-channels-alist) erc-server-coding-system '(utf-8 . utf-8) erc-track-exclude-types erc-hide-list - erc-track-position-in-mode-line 'before-modes) + erc-track-exclude-server-buffer t + erc-track-position-in-mode-line 'before-modes + erc-track-visibility nil ; only the selected frame + ) ;; Thanks bpalmer! (advice-add 'show-paren-function :around @@ -290,11 +297,12 @@ erc-track-mode erc-truncate-mode) - (setup (:straight erc-hl-nicks) - (with-eval-after-load 'erc - (require 'erc-hl-nicks) - (:option erc-hl-nicks-minimum-contrast-ratio 4.5) - (:hook-into erc-mode)))) + ;; (setup (:straight erc-hl-nicks) + ;; (with-eval-after-load 'erc + ;; (require 'erc-hl-nicks) + ;; (:option erc-hl-nicks-minimum-contrast-ratio 4.5) + ;; (:hook-into erc-mode))) + ) (setup eshell (:also-load acdw-eshell -- cgit 1.4.1-21-gabe81