summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-06-08 19:53:20 +0100
committerjao <jao@gnu.org>2021-06-08 19:53:54 +0100
commit9a20f22eab0381402bf443d72620db93102798a9 (patch)
tree5b1ff87c98d73f9c746903c22296b3f5a7668728
parentcf572d0d14909cc0f95b4560831a32a40a3be799 (diff)
downloadelibs-9a20f22eab0381402bf443d72620db93102798a9.tar.gz
elibs-9a20f22eab0381402bf443d72620db93102798a9.tar.bz2
nits
-rw-r--r--attic/misc.org149
-rw-r--r--email.org3
-rw-r--r--init.org155
-rw-r--r--lib/eos/jao-ednc.el2
4 files changed, 154 insertions, 155 deletions
diff --git a/attic/misc.org b/attic/misc.org
index 7087111..7dd38cf 100644
--- a/attic/misc.org
+++ b/attic/misc.org
@@ -417,155 +417,6 @@
:diminish ((rcirc-omit-mode . "")))
#+end_src
-* erc
-*** Package
- #+begin_src emacs-lisp
- (use-package erc
- :init
- (setq erc-modules
- '(autojoin
- button
- dcc
- fill
- irccontrols
- match
- move-to-prompt
- netsplit
- networks
- noncommands
- notify
- pcomplete
- ring
- services
- stamp
- track
- truncate))
-
- (setq erc-auto-query 'bury
- erc-autojoin-channels-alist `(("libera.chat" ,@jao-libera-channels))
- erc-away-nickname "jao"
- erc-button-buttonize-nicks t
- erc-common-server-suffixes '(("freenode.net$" . "fn")
- ("libera.chat$" . "lb"))
- erc-current-nick-highlight-type 'nick-or-keyword
- erc-email-userid (car jao-mails)
- erc-fill-column 84
- erc-fill-prefix " "
- erc-format-nick-function 'erc-format-@nick
- erc-header-line-face-method t
- erc-header-line-format nil ;; "%l %o"
- erc-header-line-uses-tabbar-p nil
- erc-hide-list '("JOIN" "PART" "QUIT")
- erc-hide-timestamps nil
- erc-input-line-position -1
- erc-insert-timestamp-function 'erc-insert-timestamp-right
- erc-join-buffer 'bury
- erc-kill-buffer-on-part t
- erc-kill-queries-on-quit t
- erc-log-channels-directory nil
- erc-mode-line-away-status-format "(a)"
- erc-mode-line-format "%t"
- erc-nick "jao"
- erc-notice-highlight-type 'all
- erc-notice-prefix "- "
- erc-notify-signoff-hook 'erc-notify-signoff
- erc-notify-signon-hook 'erc-notify-signon
- erc-pcomplete-nick-postfix ","
- erc-rename-buffers t
- erc-server-send-ping-timeout 60
- erc-prompt ":"
- erc-prompt-for-nickserv-password nil
- erc-use-auth-source-for-nickserv-password t
- erc-prompt-for-password nil
- erc-public-away-p t
- erc-server "irc.libera.chat"
- erc-server-coding-system '(utf-8 . undecided)
- erc-server-reconnect-attempts 10
- erc-server-reconnect-timeout 10
- erc-timestamp-format "%H:%M"
- erc-timestamp-only-if-changed-flag t
- erc-timestamp-right-column 84
- erc-user-full-name "https://jao.io"
- erc-user-mode "+i"
- erc-whowas-on-nosuchnick t)
-
- :config
-
- (define-minor-mode ncm-erc-mode "" nil
- (:eval (format " [%s]" (hash-table-count erc-channel-users))))
-
- (add-hook 'erc-mode-hook (lambda () (ncm-erc-mode 1)))
- (add-hook 'erc-mode-hook (lambda () (auto-fill-mode -1))))
- #+end_src
-*** No angles
- #+begin_src emacs-lisp
- (defun jao-erc--no-angles (old-func &rest args)
- (let ((msg (apply old-func args)))
- (replace-regexp-in-string "^<\\([^>]+\\)>" "(\\1)" msg)))
-
- (with-eval-after-load "erc"
- (modify-syntax-entry ?\( "." erc-mode-syntax-table)
- (modify-syntax-entry ?\) "." erc-mode-syntax-table)
- (advice-add 'erc-format-privmessage :around #'jao-erc--no-angles)
- (advice-add 'erc-format-my-nick :around #'jao-erc--no-angles))
- #+end_src
-*** Tracking
- #+begin_src emacs-lisp
- (defun jao-erc-track-shorten (names)
- (let ((names (erc-track-shorten-names names)))
- (mapcar (lambda (n) (string-remove-prefix "#" n)) names)))
-
- (setq erc-track-exclude-server-buffer t
- erc-track-exclude-types '("NICK" "JOIN" "PART" "QUIT" "MODE" "KICK")
- erc-track-remove-disconnected-buffers t
- erc-track-shorten-aggressively t ;; 'max
- erc-track-shorten-function #'jao-erc-track-shorten
- erc-track-switch-direction 'importance
- erc-track-visibility nil ;; t all, nil only selected frame
- erc-track-position-in-mode-line nil
- erc-track-enable-keybindings nil ;; 'ask
- erc-track-faces-priority-list '(erc-error-face
- erc-current-nick-face
- erc-pal-face
- erc-direct-msg-face
- erc-nick-msg-face
- erc-default-face
- erc-action-face
- erc-notice-face))
- (defun jao-track-erc-buffers ()
- (dolist (e erc-modified-channels-alist)
- (tracking-add-buffer (car e) (list (cddr e)))))
-
- (with-eval-after-load "erc-track"
- (require 'tracking nil t)
- (add-hook 'exwm-workspace-switch-hook #'erc-modified-channels-update)
- (add-hook 'erc-track-list-changed-hook #'jao-track-erc-buffers))
-
- (jao-shorten-modes 'erc-mode)
- (jao-tracking-faces 'erc-error-face
- 'erc-pal-face
- 'erc-current-nick-face
- 'erc-direct-msg-face)
- #+end_src
-*** Commands (/recover &co.)
- #+begin_src emacs-lisp
- (defun erc-cmd-RECOVER (&rest ignore)
- "Recover nick"
- (let ((fn (jao--get-user/password "freenode")))
- (erc-cmd-MSG (format "nickserv IDENTIFY %s %s" (car fn) (cadr fn)))
- (erc-cmd-MSG (format "nickserv GHOST %s" (car fn)))
- (erc-cmd-MSG (format "nickserv RELEASE %s" (car fn)))
- (erc-cmd-NICK (car fn))))
- #+end_src
-*** Startup
- #+begin_src emacs-lisp
- (defun jao-erc (&optional yes)
- (interactive "P")
- ;; (when (or yes (y-or-n-p "Connect to bitlbee using ERC? "))
- ;; (erc-select :server "localhost"))
- (when (or yes (y-or-n-p "Connect to libera using ERC? "))
- (erc-select :server "irc.libera.chat")))
- #+end_src
* switch window
An alternative for this one is ace-window, but it has the problem
of not displaying its overlay over org buffers (sometimes) and
diff --git a/email.org b/email.org
index 2e3e5af..ceb2022 100644
--- a/email.org
+++ b/email.org
@@ -380,7 +380,8 @@
,@(jao-notmuch--mboxes-search "feeds")
,(jao-notmuch--q "gmane/emacs" nil "e"
'("tag:gmane" "tag:new" "tag:emacs"))
- ,(jao-notmuch--q "gmane" nil "g" '("tag:gmane" "tag:new"))
+ ,(jao-notmuch--q "gmane" nil "g"
+ '("tag:gmane" "tag:new" "not tag:emacs"))
,(jao-notmuch--q "bml/today" nil "tb" '("tag:bigml" "date:1d..") t)
,(jao-notmuch--q "jao/today" nil "tj" '("tag:jao" "date:1d..") t)
,(jao-notmuch--q "flagged" nil "r" '("tag:flagged") t)
diff --git a/init.org b/init.org
index 50ee240..367a606 100644
--- a/init.org
+++ b/init.org
@@ -450,8 +450,6 @@
;; (jao-toggle-inactive-mode-line t)
(exwm-enable)
(jao-trisect t)
- (jao-exwm-xmobar)
- (jao-nm-applet)
(message "Welcome to exwm"))
#+end_src
*** sway
@@ -2690,6 +2688,154 @@
(jao-exec-in-vterm (format "ssh %s" h) (format "* %s *" h))))
#+end_src
* Chats
+*** erc
+***** Package
+ #+begin_src emacs-lisp
+ (use-package erc
+ :init
+ (setq erc-modules
+ '(autojoin
+ button
+ dcc
+ fill
+ irccontrols
+ match
+ move-to-prompt
+ netsplit
+ networks
+ noncommands
+ notify
+ pcomplete
+ ring
+ services
+ stamp
+ track
+ truncate))
+
+ (setq erc-auto-query 'bury
+ erc-autojoin-channels-alist `(("libera.chat" ,@jao-libera-channels))
+ erc-away-nickname "jao"
+ erc-button-buttonize-nicks t
+ erc-common-server-suffixes '(("libera.chat$" . "lb"))
+ erc-current-nick-highlight-type 'nick-or-keyword
+ erc-email-userid (car jao-mails)
+ erc-fill-column 84
+ erc-fill-prefix " "
+ erc-format-nick-function 'erc-format-@nick
+ erc-header-line-face-method t
+ erc-header-line-format nil ;; "%l %o"
+ erc-header-line-uses-tabbar-p nil
+ erc-hide-list '("JOIN" "PART" "QUIT")
+ erc-hide-timestamps nil
+ erc-input-line-position -1
+ erc-insert-timestamp-function 'erc-insert-timestamp-right
+ erc-join-buffer 'bury
+ erc-kill-buffer-on-part t
+ erc-kill-queries-on-quit t
+ erc-log-channels-directory nil
+ erc-mode-line-away-status-format "(a)"
+ erc-mode-line-format "%t"
+ erc-nick "jao"
+ erc-notice-highlight-type 'all
+ erc-notice-prefix "- "
+ erc-notify-signoff-hook 'erc-notify-signoff
+ erc-notify-signon-hook 'erc-notify-signon
+ erc-pcomplete-nick-postfix ","
+ erc-rename-buffers t
+ erc-server-send-ping-timeout 60
+ erc-prompt ":"
+ erc-prompt-for-nickserv-password nil
+ erc-use-auth-source-for-nickserv-password t
+ erc-prompt-for-password nil
+ erc-public-away-p t
+ erc-server "irc.libera.chat"
+ erc-server-coding-system '(utf-8 . undecided)
+ erc-server-reconnect-attempts 10
+ erc-server-reconnect-timeout 10
+ erc-timestamp-format "%H:%M"
+ erc-timestamp-only-if-changed-flag t
+ erc-timestamp-right-column 84
+ erc-user-full-name "https://jao.io"
+ erc-user-mode "+i"
+ erc-whowas-on-nosuchnick t)
+
+ :config
+
+ (define-minor-mode ncm-erc-mode "" nil
+ (:eval (format " [%s]" (hash-table-count erc-channel-users))))
+
+ (add-hook 'erc-mode-hook (lambda () (ncm-erc-mode 1)))
+ (add-hook 'erc-mode-hook (lambda () (auto-fill-mode -1))))
+ #+end_src
+***** No angles
+ #+begin_src emacs-lisp
+ (defun jao-erc--no-angles (old-func &rest args)
+ (let ((msg (apply old-func args)))
+ (replace-regexp-in-string "^<\\([^>]+\\)>" "(\\1)" msg)))
+
+ (with-eval-after-load "erc"
+ (modify-syntax-entry ?\( "." erc-mode-syntax-table)
+ (modify-syntax-entry ?\) "." erc-mode-syntax-table)
+ (advice-add 'erc-format-privmessage :around #'jao-erc--no-angles)
+ (advice-add 'erc-format-my-nick :around #'jao-erc--no-angles))
+ #+end_src
+***** Tracking
+ #+begin_src emacs-lisp
+ (defun jao-erc-track-shorten (names)
+ (let ((names (erc-track-shorten-names names)))
+ (mapcar (lambda (n) (string-remove-prefix "#" n)) names)))
+
+ (setq erc-track-exclude-server-buffer t
+ erc-track-exclude-types '("NICK" "JOIN" "PART" "QUIT" "MODE" "KICK")
+ erc-track-remove-disconnected-buffers t
+ erc-track-shorten-aggressively t ;; 'max
+ erc-track-shorten-function #'jao-erc-track-shorten
+ erc-track-switch-direction 'importance
+ erc-track-visibility nil ;; t all, nil only selected frame
+ erc-track-position-in-mode-line nil
+ erc-track-enable-keybindings nil ;; 'ask
+ erc-track-faces-priority-list '(erc-error-face
+ erc-current-nick-face
+ erc-pal-face
+ erc-direct-msg-face
+ erc-nick-msg-face
+ erc-default-face
+ erc-action-face
+ erc-notice-face))
+ (defun jao-track-erc-buffers ()
+ (dolist (e erc-modified-channels-alist)
+ (tracking-add-buffer (car e) (list (cddr e)))))
+
+ (with-eval-after-load "erc-track"
+ (require 'tracking nil t)
+ (add-hook 'exwm-workspace-switch-hook #'erc-modified-channels-update)
+ (add-hook 'erc-track-list-changed-hook #'jao-track-erc-buffers))
+
+ (jao-shorten-modes 'erc-mode)
+ (jao-tracking-faces 'erc-error-face
+ 'erc-pal-face
+ 'erc-current-nick-face
+ 'erc-direct-msg-face)
+ #+end_src
+***** Commands (/recover &co.)
+ #+begin_src emacs-lisp
+ (defun erc-cmd-RECOVER (&rest ignore)
+ "Recover nick"
+ (let ((fn (jao--get-user/password "freenode")))
+ (erc-cmd-MSG (format "nickserv IDENTIFY %s %s" (car fn) (cadr fn)))
+ (erc-cmd-MSG (format "nickserv GHOST %s" (car fn)))
+ (erc-cmd-MSG (format "nickserv RELEASE %s" (car fn)))
+ (erc-cmd-NICK (car fn))))
+ #+end_src
+***** Startup
+ #+begin_src emacs-lisp
+ (defun jao-erc (&optional yes)
+ (interactive "P")
+ ;; (when (or yes (y-or-n-p "Connect to bitlbee using ERC? "))
+ ;; (erc-select :server "localhost"))
+ (when (or yes (y-or-n-p "Connect to libera using ERC? "))
+ (erc-select :server "irc.libera.chat")))
+ #+end_src
*** circe
#+begin_src emacs-lisp
(defvar jao-libera-channels '())
@@ -2807,7 +2953,8 @@
(dolist (f (list slack-file-dir slack-image-file-directory))
(when (not (file-exists-p f)) (make-directory f)))
- (jao-shorten-modes 'slack-message-buffer-mode)
+ (jao-shorten-modes 'slack-message-buffer-mode
+ 'slack-thread-message-buffer-mode)
(jao-tracking-faces 'warning))
#+end_src
*** telegram
@@ -2853,7 +3000,7 @@
(when (or p (y-or-n-p "Connect to telegram? "))
(telega))
(when (or p (y-or-n-p "Connect to libera? "))
- (circe "Libera Chat")))
+ (if (y-or-n-p "Circe?") (circe "Libera Chat") (jao-erc))))
(pretty-hydra-define jao-hydra-chats (global-map "s-q" :color blue :quit-key "q")
("Connect"
diff --git a/lib/eos/jao-ednc.el b/lib/eos/jao-ednc.el
index 1a85123..5750ea7 100644
--- a/lib/eos/jao-ednc.el
+++ b/lib/eos/jao-ednc.el
@@ -60,7 +60,7 @@
(defun jao-ednc-ignore-app (app)
(jao-ednc-add-handler app
(lambda (not _)
- (when not (ednc-dismiss-notification not)))))
+ (ignore-errors (ednc-dismiss-notification not)))))
(defun jao-ednc--clean (&optional notification)
(tracking-remove-buffer (get-buffer ednc-log-name))