diff options
Diffstat (limited to '')
-rw-r--r-- | emacsconf-erc.el | 111 |
1 files changed, 86 insertions, 25 deletions
diff --git a/emacsconf-erc.el b/emacsconf-erc.el index bced63d..71b2478 100644 --- a/emacsconf-erc.el +++ b/emacsconf-erc.el @@ -26,6 +26,15 @@ ;; ;; Commands: ;; +;; /opall +;; /deopall +;; +;; general +;; - /broadcast message +;; - /conftopic message +;; +;; - /checkin nick talk +;; ;; announcements only ;; - /nowplaying slug ;; - /nowclosedq slug @@ -42,10 +51,6 @@ ;; - /markunstreamedq slug ;; - /markdone slug ;; -;; general -;; - /broadcast message -;; - /conftopic message -;; - /checkin nick ;; ;;; Code: @@ -63,12 +68,12 @@ (defcustom emacsconf-erc-org "#emacsconf-org" "Channel for organizers") (defcustom emacsconf-topic-templates - '(("#emacsconf" "Welcome to EmacsConf 2023 | please join our track-specific channels #emacsconf-gen and #emacsconf-dev as well | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") - ("#emacsconf-gen" "General track | https://emacsconf.org/2023/watch/gen/ | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") - ("#emacsconf-dev" "Development track | https://emacsconf.org/2023/watch/dev/ | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") - ("#emacsconf-accessible" "EmacsConf 2023 accessibility - help by describing what's happening | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") - ("#emacsconf-org" "EmacsConf 2023 | Dedicated channel for EmacsConf organizers and speakers | this is intended as an internal, low-traffic channel; for main discussion around EmacsConf, please join #emacsconf | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") - ("#emacsconf-questions" "EmacsConf 2023 | Low-traffic channel for questions if speakers prefer IRC and need help focusing; for main discussion around EmacsConf, please join #emacsconf | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates")) + '(("#emacsconf" "Welcome to EmacsConf 2024 | please join our track-specific channels #emacsconf-gen and #emacsconf-dev as well | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") + ("#emacsconf-gen" "General track | https://emacsconf.org/2024/watch/gen/ | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") + ("#emacsconf-dev" "Development track | https://emacsconf.org/2024/watch/dev/ | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") + ("#emacsconf-accessible" "EmacsConf 2024 accessibility - help by describing what's happening | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") + ("#emacsconf-org" "EmacsConf 2024 | Dedicated channel for EmacsConf organizers and speakers | this is intended as an internal, low-traffic channel; for main discussion around EmacsConf, please join #emacsconf | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") + ("#emacsconf-questions" "EmacsConf 2024 | Low-traffic channel for questions if speakers prefer IRC and need help focusing; for main discussion around EmacsConf, please join #emacsconf | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates")) "List of (channel topic-template) entries for mass-setting channel topics." :group 'emacsconf :type '(repeat (list (string :tag "Channel") @@ -94,19 +99,20 @@ If MESSAGE is not specified, reset the topic to the template." (cadr template))))) emacsconf-topic-templates)) -(defun erc-cmd-CHECKIN (nick) - (let* ((talk (emacsconf-complete-talk-info)) - (q-and-a (plist-get talk :q-and-a) "")) - (save-excursion - (emacsconf-with-talk-heading (plist-get talk :slug) - (org-entry-put (point) "IRC" nick) - (org-entry-put (point) "CHECK_IN" (format-time-string "%H:%M")))) +(defun erc-cmd-CHECKIN (nick &optional talk) + (let* ((talk (if (stringp talk) (emacsconf-resolve-talk talk) (or talk (emacsconf-complete-talk-info)))) + (q-and-a (or (plist-get talk :q-and-a) ""))) + (save-window-excursion + (save-excursion + (emacsconf-with-talk-heading (plist-get talk :slug) + (org-entry-put (point) "IRC" nick) + (org-entry-put (point) "CHECK_IN" (format-time-string "%H:%M"))))) (cond ((string-match "live" q-and-a) (erc-send-message (format "%s: Thanks for checking in! I'll send you some private messages with instructions, so please check there. Let me know if you don't get them." nick)) (erc-cmd-ROOM nick talk)) ((string-match "pad" q-and-a) - (erc-send-message (format "%s: Thanks for checking in! The collaborative pad we'll be using for questions is at %s . We'll collect questions and put them there. If you'd like to open it, you can keep an eye on questions. Please let us know if you need help, or if you want to switch to live Q&A." nick (plist-get talk :pad-url)))) + (erc-send-message (format "%s: Thanks for checking in! The collaborative pad we'll be using for questions is at %s . We'll collect questions and put them there. If you'd like to open it, you can keep an eye on questions. You can answer questions in any order or skip anything you want to save for later. Please let us know if you need help, or if you want to switch to live Q&A." nick (plist-get talk :pad-url)))) ((string-match "IRC" q-and-a) (erc-send-message (format "#%s: Thanks for checking in! Feel free to keep an eye on %s for questions and discussion, and we'll copy things from the pad to there. If the volume gets overwhelming, let us know and we can /msg you questions or add them to the pad. If you'd like to try Q&A over live video or the collaborative pad instead, or if you need help, please let us know." nick (plist-get (emacsconf-get-track (plist-get talk :track)) :channel)))) @@ -115,11 +121,37 @@ If MESSAGE is not specified, reset the topic to the template." (emacsconf-with-talk-heading (plist-get talk :slug) (emacsconf-upcoming-insert-or-update nil t))))) -(defun erc-cmd-BBB (nick &optional talk) +(defun erc-cmd-BACKSTAGE (nick) + "Send NICK emergency backstage information." + (erc-send-message (format "%s: I'll send you a private message on IRC with the backstage details.")) + (erc-message + "PRIVMSG" + (format "%s You can access the backstage area at %s%s/backstage/ with the username \"%s\" and the password \"%s\" (please keep them secret, thanks!). The general talk index is at %s%s/backstage/index-gen.html and the dev talk index is at %s%s/backstage/index-dev.html" + nick + emacsconf-media-base-url + emacsconf-year + emacsconf-backstage-user + emacsconf-backstage-password + emacsconf-media-base-url + emacsconf-year + emacsconf-media-base-url + emacsconf-year + ))) + +(defun erc-cmd-PAD (nick &optional talk) + (setq talk (if (stringp talk) (emacsconf-resolve-talk talk) + (or talk (emacsconf-complete-talk-info)))) + (erc-message "PRIVMSG" (format "%s The collaborative pad we'll be using for questions is at %s . We'll collect questions from %s and put them there. When you're live, you can answer questions in any order or skip anything you want to save for later. Alternatively, we can read questions to you. Let us know what you'd prefer!" nick (plist-get talk :pad-url) (plist-get talk :channel)))) + +(defun erc-cmd-ROOM (nick &optional talk) "Send live Q&A instructions to NICK." - (setq talk (or talk (emacsconf-complete-talk-info))) - (erc-message "PRIVMSG" (format "%s You can use this BBB room: %s . We'll join you there shortly to set up the room and do the last-minute tech check." nick (plist-get talk :bbb-room))) - (erc-message "PRIVMSG" (format "%s The collaborative pad we'll be using for questions is at %s . We'll collect questions from #emacsconf and put them there. If you'd like to jump to your part of the document, you might be able to keep an eye on questions. Alternatively, we can read questions to you." nick (plist-get talk :pad-url))) + (setq talk (if (stringp talk) (emacsconf-resolve-talk talk) + (or talk (emacsconf-complete-talk-info)))) + (erc-message + "PRIVMSG" + (if (plist-get talk :bbb-mod-code) + (format "%s You can use this BBB room: %s . If you use the moderator access code \"%s\" when you log in, you can get all set up to share your screen if you want. We'll join you there shortly to do the last-minute tech check." nick (plist-get talk :bbb-room) (plist-get talk :bbb-mod-code)) + (format "%s You can use this BBB room: %s . We'll join you there shortly to set up the room and do the last-minute tech check." nick (plist-get talk :bbb-room)))) (erc-message "PRIVMSG" (format "%s The host will join and give you the go-ahead when you go on air. See you in the BBB room!" nick))) (defun erc-cmd-READY (&rest filter) @@ -183,10 +215,10 @@ If MESSAGE is not specified, reset the topic to the template." (emacsconf-erc-with-channels (list (concat "#" (plist-get talk :channel))) (erc-cmd-TOPIC (format - "%s: %s (%s) pad: %s Q&A: %s | %s" + "%s: %s%s pad: %s Q&A: %s | %s" (plist-get talk :slug) (plist-get talk :title) - (plist-get talk :speakers) + (emacsconf-surround " (" (plist-get talk :speakers) ")" " -") (plist-get talk :pad-url) (plist-get talk :qa-info) (car (assoc-default @@ -195,7 +227,7 @@ If MESSAGE is not specified, reset the topic to the template." (erc-send-message (format "---- %s: %s - %s ----" (plist-get talk :slug) (plist-get talk :title) - (plist-get talk :speakers-with-pronouns))) + (emacsconf-surround " - " (plist-get talk :speakers-with-pronouns) "" ""))) (erc-send-message (concat "Add your notes/questions to the pad: " (plist-get talk :pad-url))) (cond @@ -515,5 +547,34 @@ Usage: /conflog keyword notes go here" (cons (cons (match-string-no-properties 1 string) (current-time)) (seq-take emacsconf-erc-recent-announcements (1- emacsconf-erc-recent-announcements-length)))))) +;; (keymap-set erc-mode-map "C-c w" #'emacsconf-erc-copy) +(defun emacsconf-erc-copy (&optional beg end) + "Unwrap and copy the current line to the clipboard. +This makes it easier to paste into the Etherpad." + (interactive + (list + (if (region-active-p) + (min (point) (mark))) + (if (region-active-p) + (max (point) (mark))))) + (setq beg (or beg (if (get-text-property (point) 'erc--ts) + (line-beginning-position) + (prop-match-beginning (text-property-search-backward 'erc--ts))))) + (setq end + (let ((end-field (save-excursion (text-property-search-forward 'field))) + (end-nick (save-excursion (text-property-search-forward 'erc--ts nil nil t)))) + (min (if end-field (prop-match-beginning end-field) most-positive-fixnum) + (if end-nick (prop-match-beginning end-nick) most-positive-fixnum)))) + (let* ((pulse-flag nil)) + (when (fboundp 'pulse-momentary-highlight-region) + (pulse-momentary-highlight-region beg end)) + (kill-new + (string-trim + (replace-regexp-in-string + "\n[ \t]+" " " + (buffer-substring-no-properties + beg + end)))))) + (provide 'emacsconf-erc) ;;; emacsconf-erc.el ends here |