summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2026-01-02 10:49:26 -0500
committerSacha Chua <sacha@sachachua.com>2026-01-02 10:49:26 -0500
commit6daeda036b6db86592f61a8fd49d5eb8082aa795 (patch)
tree31a12d85fb72da13b661479f5e8ab3f70159a6cb
parent05e815dd879a14d43ea4a37074513f6c8143efeb (diff)
downloademacsconf-el-6daeda036b6db86592f61a8fd49d5eb8082aa795.tar.xz
emacsconf-el-6daeda036b6db86592f61a8fd49d5eb8082aa795.zip
keyboard shortcuts for extracting IRC
-rw-r--r--emacsconf-extract.el41
1 files changed, 40 insertions, 1 deletions
diff --git a/emacsconf-extract.el b/emacsconf-extract.el
index 194d86c..3c2d21e 100644
--- a/emacsconf-extract.el
+++ b/emacsconf-extract.el
@@ -428,6 +428,15 @@
(defvar emacsconf-extract-irc-speaker-nick nil "*Nick for the speaker.")
+(defun emacsconf-extract-pad-clean-up ()
+ (interactive)
+ (goto-char (point-min))
+ (while (re-search-forward "\\\\" nil t)
+ (replace-match ""))
+ (goto-char (point-min))
+ (while (re-search-forward "{rel=\"noreferrer noopener\"}" nil t)
+ (replace-match "")))
+
(defun emacsconf-extract-selected-irc ()
"Copy the lines that start with -."
(interactive)
@@ -450,7 +459,8 @@
"<down>" #'forward-line
"<up>" #'previous-line
"<right>" (lambda () (interactive) (insert "-") (forward-line))
- "<left>" #'forward-line)
+ "<left>" #'forward-line
+ "q" #'emacsconf-extract-irc-copy-line-to-other-window-as-question)
(defun emacsconf-extract-irc-log ()
(interactive)
@@ -478,6 +488,8 @@
(match-string 1))
"A: ")
"")))
+ (when (string= (match-string 2) "https")
+ (setq line (concat (match-string 2) line)))
(setq line
(concat
(if (or (string= prefix "A: ") indent) " " "")
@@ -503,6 +515,31 @@
(emacsconf-edit-wiki-page talk))
(require 'hydra)
+
+(defvar-keymap emacsconf-extract-irc-keymap
+ :doc "Make it easy to extract lines from IRC"
+ "c" #'emacsconf-extract-irc-copy-line-to-other-window-as-list-item
+ "q" (lambda () (interactive) (emacsconf-extract-irc-copy-line-to-other-window-as-list-item "Q: "))
+ "o" #'other-window
+ "t" #'emacsconf-extract-irc-open-talk-in-other-window
+ "n" #'next-line
+ "p" #'previous-line
+ "N" #'move-line-down
+ "P" #'move-line-up
+ "<up>" #'previous-line
+ "<down>" #'next-line
+ "<right>" (lambda () (interactive) (goto-char (line-beginning-position)) (insert " "))
+ "<left>" (lambda () (interactive) (goto-char (line-beginning-position)) (delete-char 2))
+ "<prior>" #'scroll-down-command
+ "<next>" #'scroll-up-command
+ "a" (lambda () (interactive) (emacsconf-extract-irc-copy-line-to-other-window-as-list-item "A: "))
+ "l" (lambda () (interactive) (save-window-excursion (other-window 1) (consult-line)))
+ "<spc>" #'pop-to-mark-command)
+
+(defun emacsconf-extract-irc ()
+ (interactive)
+ (set-transient-map emacsconf-extract-irc-keymap t))
+
(defhydra emacsconf-extract-irc ()
"Make it easy to extract lines from IRC"
("c" emacsconf-extract-irc-copy-line-to-other-window-as-list-item "copy")
@@ -513,6 +550,8 @@
("p" previous-line "previous")
("N" move-line-down "move down")
("P" move-line-up "move up")
+ ("<up>" previous-line)
+ ("<down>" next-line)
("<right>" (progn (goto-char (line-beginning-position)) (insert " ")) "indent")
("<left>" (progn (goto-char (line-beginning-position)) (delete-char 2)) "dedent")
("<prior>" scroll-down-command)