#+title: Miscellaneous config bits that i don't use anymore * enwc #+BEGIN_SRC emacs-lisp (use-package enwc :ensure t :init (setq enwc-default-backend 'nm enwc-backend 'nm enwc-display-mode-line nil enwc-wired-device "enp3s0f0" enwc-wireless-device "wlp1s0")) #+END_SRC * frm #+begin_src emacs-lisp (use-package jao-frm :init (setq jao-frm-mail-command 'jao-open-gnus-frame)) (defun jao-frm--formatter (mbox n) (apply #'format "%s/%s: %s" `(,@(last (split-string mbox "/") 2) ,n))) (defun jao-frm--show () (interactive) (jao-frm-show-mail-numbers #'jao-frm--formatter)) (global-set-key [(f12)] 'jao-frm--show) (global-set-key [(f8)] 'jao-frm) #+end_src * mu4e #+begin_src emacs-lisp (jao-load-path "mu4e") (use-package mu4e :init (setq mu4e-attachment-dir (expand-file-name "~/var/download/attachments") mu4e-change-filenames-when-moving nil mu4e-completing-read-function 'completing-read mu4e-display-update-status-in-modeline nil mu4e-get-mail-command "run-mb.sh || [ $? -eq 1 ]" mu4e-headers-show-threads t mu4e-headers-sort-direction 'ascending mu4e-headers-visible-columns 100 mu4e-headers-visible-lines 12 mu4e-hide-index-messages t mu4e-index-cleanup t ;; don't do a full cleanup check mu4e-index-lazy-check t ;; don't consider up-to-date dirs mu4e-maildir "~/var/mail/" mu4e-split-view 'horizontal ;; 'vertical mu4e-update-interval 300 mu4e-use-fancy-chars nil mu4e-user-mail-address-list jao-mails mu4e-view-show-addresses t mu4e-view-show-images t mu4e-maildir-shortcuts '((:maildir "/jao/inbox" :key ?j) (:maildir "/bigml/inbox" :key ?b)) jao-mu4e-uninteresting-mail-query (concat "flag:unread AND NOT flag:trashed" " AND NOT (maildir:/bigml/inbox OR maildir:/bigml/bugs OR" " maildir:/bigml/support OR maildir:/jao/inbox)") jao-mu4e-interesting-mail-query (concat "flag:unread AND NOT flag:trashed" " AND (maildir:/bigml/inbox OR maildir:/bigml/bugs OR" " maildir:/bigml/support OR maildir:/jao/inbox)") mu4e-bookmarks `((:name "Inbox" :query ,jao-mu4e-interesting-mail-query :key ?i) (:name "Other messages" :query ,jao-mu4e-uninteresting-mail-query :key 117) (:name "Today's messages" :query "date:today..now" :key 116) (:name "Last 7 days" :query "date:7d..now" :hide-unread t :key 119) (:name "Messages with PDFs" :query "mime:application/pdf OR mime:x-application/pdf" :key 112))) :config (defun jao-mu4e--maildir (msg) (when msg (let ((md (mu4e-message-field msg :maildir))) (when (string-match "/\\([^/]+\\)/.*" md) (match-string 1 md))))) (defun jao-mu4e--refile-folder (msg) (let ((md (jao-mu4e--maildir msg))) (if (string= md "trove") "/trove/jao" (format "/trove/%" md)))) (setq mu4e-sent-folder #'jao-mu4e--refile-folder) (setq mu4e-drafts-folder "/trove/drafts") (setq mu4e-trash-folder "/trash") (setq mu4e-refile-folder 'jao-mu4e--refile-folder) (setq mu4e-contexts nil) (setq mu4e-view-show-images t) (when (fboundp 'imagemagick-register-types) (imagemagick-register-types)) (define-key mu4e-view-mode-map [remap mu4e-view-verify-msg-popup] 'epa-mail-verify) ;; View html message in browser (type aV) (add-to-list 'mu4e-view-actions '("ViewInBrowser" . mu4e-action-view-in-browser) t)) #+end_src * company #+begin_src emacs-lisp (use-package company :ensure t :custom ((company-backends '(company-capf company-bbdb company-files company-dabbrev company-keywords)) (company-global-modes '(not slack-message-buffer-mode circe-channel-mode telega-chat-mode)) (company-format-margin-function nil) ;; #'company-text-icons-margin (company-idle-delay 0.2) (company-lighter "") (company-lighter-base "") (company-show-numbers nil) (company-selection-wrap-around t) (company-tooltip-limit 15) (company-tooltip-align-annotations t) (company-tooltip-offset-display 'lines)) ;; 'scrollbar :config (defun jao-complete-at-point () "Complete using company unless we're in the minibuffer." (interactive) (if (or (not company-mode) (window-minibuffer-p)) (completion-at-point) (company-manual-begin))) (defun jao-company-use-in-tab () (global-set-key [remap completion-at-point] #'jao-complete-at-point) (global-set-key [remap completion-symbol] #'jao-complete-at-point) (global-set-key (kbd "M-TAB") #'jao-complete-at-point)) (jao-company-use-in-tab) :bind (:map company-active-map ("" . #'company-complete-common-or-cycle) ("TAB" . #'company-complete-common-or-cycle) ("C-h" . #'company-show-doc-buffer) ("M-." . #'company-show-location) :filter (or (not (derived-mode-p 'eshell-mode)) (company-explicit-action-p)) ("" . #'company-complete-selection) ("RET" . #'company-complete-selection)) :diminish) (global-company-mode 1) #+end_src * rcirc #+begin_src emacs-lisp :load no (use-package rcirc :init (setq rcirc-server-alist `(("irc.libera.chat" :encryption tls :port 6697 :channels ,jao-irc-channels)) rcirc-default-user-full-name "http://jao.io/" rcirc-buffer-maximum-lines 1000 rcirc-fill-column 82 rcirc-fill-prefix " " rcirc-time-format "%H:%M " rcirc-kill-channel-buffers t rcirc-response-formats '(("PRIVMSG" . "(%N) %m") ("NOTICE" . "-%N- %m") ("ACTION" . "(... %N %m)") ("COMMAND" . "%m") ("ERROR" . "%fw!!! %m") (t . "%fp*** %fs%n %r %m")) rcirc-prompt ": " rcirc-nick-completion-format "%s, " rcirc-reconnect-delay 120 rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY" "MODE" "KEEPALIVE")) :config (let ((fn (jao--get-user/password "libera")) (btl (jao--get-user/password "bitlbee"))) (setq rcirc-authinfo `(("libera" nickserv ,(nth 0 fn) ,(nth 1 fn)) ("localhost" bitlbee ,(nth 0 btl) ,(nth 1 btl))))) (jao-shorten-modes 'rcirc-mode) (define-minor-mode ncm-mode "" nil (:eval (format " [%S]" (length (rcirc-channel-nicks (rcirc-buffer-process) rcirc-target))))) (defun jao-rcirc-track () (dolist (b rcirc-activity) (tracking-add-buffer b)) (jao-minibuffer-refresh)) (add-hook 'rcirc-update-activity-string-hook #'jao-rcirc-track) (add-hook 'rcirc-mode-hook #'ncm-mode) (add-hook 'rcirc-mode-hook #'rcirc-omit-mode) :diminish ((rcirc-omit-mode . ""))) #+end_src * circe #+begin_src emacs-lisp (defvar jao-irc-channels '()) (use-package circe :ensure t :bind (:map circe-channel-mode-map (("C-c C-a" . lui-track-jump-to-indicator))) :init (setq circe-default-realname "https://jao.io" circe-default-part-message "" circe-default-quit-message "" circe-ignore-list nil circe-server-coding-system '(undecided . undecided) circe-server-killed-confirmation 'ask-and-kill-all circe-server-auto-join-default-type :after-auth circe-format-say "({nick}) {body}" circe-format-self-say "(jao) {body}" circe-new-buffer-behavior 'ignore circe-new-buffer-behavior-ignore-auto-joins t circe-nickserv-ghost-style 'after-auth circe-prompt-string ": " circe-completion-suffix ", " circe-reduce-lurker-spam t circe-nick-next-function (lambda (old) (replace-regexp-in-string "-" "`" (circe-nick-next old))) circe-lagmon-mode-line-format-string "" ;; "%.0f " circe-lagmon-mode-line-unknown-lag-string "" ;; "? " circe-lagmon-timer-tick 120 circe-lagmon-reconnect-interval 180 lui-max-buffer-size 30000 lui-fill-column 80 lui-time-stamp-position 'right lui-time-stamp-format "%H:%M" lui-flyspell-p nil lui-track-indicator 'fringe lui-track-behavior 'before-tracking-next-buffer) :config (defun circe-command-RECOVER (&rest ignore) "Recover nick" (let* ((fn (jao--get-user/password "freenode")) (u (car fn)) (p (cadr fn))) (circe-command-MSG "nickserv" (format "IDENTIFY %s %s" u p)) (circe-command-MSG "nickserv" (format "GHOST %s" u)) (circe-command-MSG "nickserv" (format "RELEASE %s" u)) (circe-command-NICK u))) (defvar jao-bitlbee-channels ()) (setq circe-network-options (let ((up (jao--get-user/password "freenode")) (bup (jao--get-user/password "bitlbee"))) `(("libera" :host "irc.libera.chat" :port 6667 :nick ,(car up) :channels ,jao-irc-channels :tls t :nickserv-password ,(cadr up)) ("Freenode" :nick ,(car up) :channels ,jao-irc-channels :tls t :sasl-username ,(car up) :sasl-password ,(cadr up)) ("Bitlbee" :host "127.0.0.1" :nick ,(car bup) :channels ,jao-bitlbee-channels :lagmon-disabled t :nickserv-password ,(cadr bup) :user ,(car bup))))) (jao-shorten-modes 'circe-channel-mode 'circe-server-mode 'circe-query-mode) (circe-lagmon-mode) (enable-circe-color-nicks) (enable-circe-display-images) (enable-lui-track)) #+end_src