From 083c922ebcece6fc7a7545225d1096d0d49d95c3 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 15 Sep 2021 17:33:12 -0500 Subject: [PATCH 1/4] Patch circe --- init.el | 6 +++++- lisp/acdw-irc.el | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 4a4c57c..1f03fad 100644 --- a/init.el +++ b/init.el @@ -243,7 +243,9 @@ AKA, DO NOT USE THIS FUNCTION!!!" ;; TODO: irc.chat.twitch.tv ) circe-reduce-lurker-spam t - circe-server-auto-join-default-type :after-auth) + circe-server-auto-join-default-type :after-auth + circe-server-buffer-action (lambda (buf) + (message "Connected to %s" buf))) ;; (:face circe-nick-highlight-face ;; ((t (:inherit (modus-themes-hl-line))))) @@ -637,6 +639,8 @@ AKA, DO NOT USE THIS FUNCTION!!!" (defun edit-server@set-a-variable (&rest _) (setq-local edit-server-frame-p t)))) +(setup (:straight el-patch)) + (setup eldoc (:option eldoc-idle-delay 0.1 eldoc-echo-area-use-multiline-p nil)) diff --git a/lisp/acdw-irc.el b/lisp/acdw-irc.el index b4b75ec..305dc93 100644 --- a/lisp/acdw-irc.el +++ b/lisp/acdw-irc.el @@ -73,6 +73,41 @@ and right on t." (dolist (network (mapcar #'car circe-network-options)) (circe-maybe-connect network))) +(el-patch-feature circe) +(with-eval-after-load 'circe + (defvar circe-server-buffer-action 'pop-to-buffer-same-window + "What to do with `circe-server' buffers when created.") + + (el-patch-defun circe (network-or-server &rest server-options) + "Connect to IRC. + +Connect to the given network specified by NETWORK-OR-SERVER. + +When this function is called, it collects options from the +SERVER-OPTIONS argument, the user variable +`circe-network-options', and the defaults found in +`circe-network-defaults', in this order. + +If NETWORK-OR-SERVER is not found in any of these variables, the +argument is assumed to be the host name for the server, and all +relevant settings must be passed via SERVER-OPTIONS. + +All SERVER-OPTIONS are treated as variables by getting the string +\"circe-\" prepended to their name. This variable is then set +locally in the server buffer. + +See `circe-network-options' for a list of common options." + (interactive (circe--read-network-and-options)) + (let* ((options (circe--server-get-network-options network-or-server + server-options)) + (buffer (circe--server-generate-buffer options))) + (with-current-buffer buffer + (circe-server-mode) + (circe--server-set-variables options) + (circe-reconnect)) + (el-patch-swap (pop-to-buffer-same-window buffer) + (funcall circe-server-buffer-action buffer))))) + (defun circe-network-connected-p (network) "Return non-nil if there's any Circe server-buffer whose `circe-server-netwok' is NETWORK." From 9d67993dd78aa085e4c575d986f065fd141dec7f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 15 Sep 2021 17:33:24 -0500 Subject: [PATCH 2/4] DO store customizations And load the file!!! oooof --- init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 1f03fad..9b2718b 100644 --- a/init.el +++ b/init.el @@ -443,13 +443,18 @@ AKA, DO NOT USE THIS FUNCTION!!!" (blink-cursor-mode +1)) (setup cus-edit - (:option custom-file null-device ; don't store customizations + (:option custom-file (acdw/dir "custom.el") custom-magic-show nil custom-magic-show-button t custom-raised-buttons nil custom-unlispify-tag-names nil custom-variable-default-form 'lisp) + ;; I need this to save `safe-local-variables' between Emacs invocations. For + ;; now, of course .... I would /love/ a better solution. + (when (file-exists-p custom-file) + (load custom-file nil nil)) + ;; `Custom-mode-hook' fires /before/ the widgets are built, so I have to ;; install advice after the widgets are made. (:advise custom-buffer-create :after From cbe051fd637dc529d271331a49582c9f60b26ba8 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 15 Sep 2021 17:33:49 -0500 Subject: [PATCH 3/4] Add acdw/org-export-copy Better'n `acdw/copy-region-plain' --- lisp/acdw.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lisp/acdw.el b/lisp/acdw.el index 0790f2e..40aff5d 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -395,6 +395,30 @@ first." (setq deactivate-mark t) nil) +(defun acdw/org-export-copy () + "copy a tree" + (interactive) + (require 'ox-ascii) + (let ((extracted-heading (acdw/org-extract-heading-text))) + ;; Export to ASCII - not async, subtree only, visible-only, body-only + (let ((org-export-show-temporary-export-buffer nil)) + (org-ascii-export-as-ascii nil t t t)) + (with-current-buffer "*Org ASCII Export*" + (goto-char (point-min)) + (insert extracted-heading) + (newline) + (newline) + + (unfill-region (point-min) (point-max)) + (flush-lines "^$" (point-min) (point-max)) + + (copy-region-as-kill (point-min) (point-max))) + + (when (called-interactively-p 'interactive) + (indicate-copied-region)) + (setq deactivate-mark t) + nil)) + (defun acdw/org-extract-heading-text () "Extract the heading text from an `org-mode' heading." (let ((heading (org-no-properties (org-get-heading t t t t)))) From 4f2b5439b9e687288074cba87b5b0a8e3de999b6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 15 Sep 2021 17:34:20 -0500 Subject: [PATCH 4/4] blech gotta go --- init.el | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index 9b2718b..4a538f1 100644 --- a/init.el +++ b/init.el @@ -1067,7 +1067,7 @@ specific to most general, they are these: (:with-feature flyspell (:bind "C-." #'flyspell-correct-wrapper "" #'acdw/flyspell-correct-f7) - (:unbind "C-," "C-." "C-M-i"))) + (:unbind "C-;" "C-," "C-." "C-M-i"))) (setup (:straight-if forge (acdw/system :home)) @@ -1309,9 +1309,26 @@ specific to most general, they are these: w3m-link w3m-message-link)) (link-hint-define-type type - :open-secondary browse-url-secondary-browser-function)) + :open-secondary browse-url-secondary-browser-function + :open-secondary-multiple t)) - (:option link-hint-avy-style 'at) + (defun acdw/link-hint-open-all-links (prefix) + "Open all visible links. +When PREFIX is non-nil, open links with +`browse-url-secondary-browser-function'." + (interactive "P") + (avy-with link-hint-open-all-links + (link-hint--all (if prefix :open-secondary :open)))) + + (defun acdw/link-hint-open-multiple-links (prefix) + "Use `avy' to open multiple visible links at once. +When PREFIX is non-nil, open links with +`browse-url-secondary-browser-function'." + (interactive "P") + (avy-with link-hint-open-multiple-links + (link-hint--multiple (if prefix :open-secondary :open)))) + + (:option link-hint-avy-style 'post) (:global "C-;" (defun acdw/link-hint-open-link (arg) "Open a link using `link-hint-open-link', prefix-aware. @@ -1663,9 +1680,9 @@ browser defined in `browse-url-secondary-browser-function'." (setup (:straight powerthesaurus) (:global "C-c l t" #'powerthesaurus-lookup-word-dwim)) -(setup (:straight prism) - (dolist (mode lispy-modes) - (add-hook (intern (format "%s-hook" mode)) #'prism-mode))) +;; (setup (:straight prism) +;; (dolist (mode lispy-modes) +;; (add-hook (intern (format "%s-hook" mode)) #'prism-mode))) (setup prog (:option show-paren-delay 0