From 90f051d46a1d9cfbae5d9c2984a96a621ae4a82a Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Sun, 31 Mar 2024 21:40:41 -0400 Subject: Merge .emacs.d/lisp/bandali-*.el into .emacs.d/init.el Somewhat major overhaul. Worth mentioning are the b/keymap-* wrappers added around the newly introduced keymap-* functions in GNU Emacs 29. Also dropped some mostly unused configs like exwm and org. --- .emacs.d/lisp/bandali-dired.el | 95 --------- .emacs.d/lisp/bandali-erc.el | 200 ------------------ .emacs.d/lisp/bandali-eshell.el | 97 --------- .emacs.d/lisp/bandali-exwm.el | 352 -------------------------------- .emacs.d/lisp/bandali-gnus.el | 430 --------------------------------------- .emacs.d/lisp/bandali-ibuffer.el | 110 ---------- .emacs.d/lisp/bandali-message.el | 110 ---------- .emacs.d/lisp/bandali-org.el | 125 ------------ .emacs.d/lisp/bandali-po.el | 61 ------ .emacs.d/lisp/bandali-theme.el | 79 ------- 10 files changed, 1659 deletions(-) delete mode 100644 .emacs.d/lisp/bandali-dired.el delete mode 100644 .emacs.d/lisp/bandali-erc.el delete mode 100644 .emacs.d/lisp/bandali-eshell.el delete mode 100644 .emacs.d/lisp/bandali-exwm.el delete mode 100644 .emacs.d/lisp/bandali-gnus.el delete mode 100644 .emacs.d/lisp/bandali-ibuffer.el delete mode 100644 .emacs.d/lisp/bandali-message.el delete mode 100644 .emacs.d/lisp/bandali-org.el delete mode 100644 .emacs.d/lisp/bandali-po.el delete mode 100644 .emacs.d/lisp/bandali-theme.el (limited to '.emacs.d/lisp') diff --git a/.emacs.d/lisp/bandali-dired.el b/.emacs.d/lisp/bandali-dired.el deleted file mode 100644 index 0cbd7ed..0000000 --- a/.emacs.d/lisp/bandali-dired.el +++ /dev/null @@ -1,95 +0,0 @@ -;;; bandali-dired.el --- bandali's dired setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2018-2022 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: files - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My dired setup and customizations. - -;;; Code: - -(with-eval-after-load 'dired - ;; (require 'ls-lisp) - (setq - dired-dwim-target t - dired-listing-switches "-alh --group-directories-first" - dired-recent-directories-file (b/var "dired-recent-directories.el") - ls-lisp-dirs-first t - ls-lisp-use-insert-directory-program nil) - - (declare-function dired-dwim-target-directory "dired-aux") - ;; easily diff 2 marked files - ;; https://oremacs.com/2017/03/18/dired-ediff/ - (defun dired-ediff-files () - (interactive) - (require 'dired-aux) - (defvar ediff-after-quit-hook-internal) - (let ((files (dired-get-marked-files)) - (wnd (current-window-configuration))) - (if (<= (length files) 2) - (let ((file1 (car files)) - (file2 (if (cdr files) - (cadr files) - (read-file-name - "file: " - (dired-dwim-target-directory))))) - (if (file-newer-than-file-p file1 file2) - (ediff-files file2 file1) - (ediff-files file1 file2)) - (add-hook 'ediff-after-quit-hook-internal - (lambda () - (setq ediff-after-quit-hook-internal nil) - (set-window-configuration wnd)))) - (error "no more than 2 files should be marked")))) - - (defun b/dired-start-process (program &optional args) - "Open current file with a PROGRAM." - ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS - ;; can be nil, so remove it). - (declare-function dired-get-file-for-visit "dired") - (apply #'b/start-process - program - (remove nil (list args (dired-get-file-for-visit))))) - - ;; local key bindings - (define-key dired-mode-map (kbd "b") #'dired-up-directory) - (define-key dired-mode-map (kbd "E") #'dired-ediff-files) - (define-key dired-mode-map (kbd "e") #'dired-toggle-read-only) - (define-key dired-mode-map (kbd "\\") #'dired-hide-details-mode) - (define-key dired-mode-map (kbd "z") - (lambda () - (interactive) - (b/dired-start-process "zathura"))) - - (require 'dired-x) - (setq - dired-guess-shell-alist-user - '(("\\.pdf\\'" "evince" "zathura" "okular") - ("\\.doc\\'" "libreoffice") - ("\\.docx\\'" "libreoffice") - ("\\.ppt\\'" "libreoffice") - ("\\.pptx\\'" "libreoffice") - ("\\.xls\\'" "libreoffice") - ("\\.xlsx\\'" "libreoffice") - ("\\.flac\\'" "mpv")))) -;; hooks -(add-hook 'dired-mode-hook #'dired-hide-details-mode) - -(provide 'bandali-dired) -;;; bandali-dired.el ends here diff --git a/.emacs.d/lisp/bandali-erc.el b/.emacs.d/lisp/bandali-erc.el deleted file mode 100644 index 8cd1457..0000000 --- a/.emacs.d/lisp/bandali-erc.el +++ /dev/null @@ -1,200 +0,0 @@ -;;; bandali-erc.el --- bandali's ERC setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2018-2022 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: IRC, chat, client, Internet - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My ERC setup for IRC in GNU Emacs. - -;;; Code: - -(with-eval-after-load 'erc - (make-directory (b/var "erc/dcc") t) - (setq - erc-auto-query 'bury - erc-autojoin-domain-only nil - erc-dcc-get-default-directory (b/var "erc/dcc") - erc-email-userid "bandali" - erc-format-nick-function 'erc-format-@nick - erc-join-buffer 'bury - ;; erc-lurker-hide-list '("JOIN" "PART" "QUIT") - erc-nick "bandali" - erc-prompt "erc>" - erc-prompt-for-password nil - erc-query-display 'buffer - erc-rename-buffers t - erc-server-reconnect-attempts 5 - erc-server-reconnect-timeout 3) - - (declare-function erc-message "erc-backend" - (message-command line &optional force)) - (declare-function erc-default-target "erc") - (declare-function erc-current-nick "erc") - (defun erc-cmd-OPME () - "Ask chanserv to op me in the current channel." - (erc-message "PRIVMSG" - (format "chanserv op %s %s" - (erc-default-target) - (erc-current-nick)) - nil)) - (declare-function erc-cmd-DEOP "erc" (&rest people)) - (defun erc-cmd-DEOPME () - "Deop myself in the current channel." - (erc-cmd-DEOP (format "%s" (erc-current-nick)))) - (add-to-list 'erc-modules 'keep-place) - (add-to-list 'erc-modules 'log) - (when (display-graphic-p) - (add-to-list 'erc-modules 'notifications) - (add-to-list 'erc-modules 'smiley)) - (add-to-list 'erc-modules 'spelling) - - ;; (set-face-attribute - ;; 'erc-nick-default-face nil - ;; ;; :weight 'semibold - ;; ;; :background "#f2f2f2" - ;; ;; :foreground "#222222" - ;; :weight 'bold - ;; :background "#f8f8f8" - ;; :foreground "#6a6a6a") - - ;; (set-face-attribute - ;; 'erc-notice-face nil - ;; ;; :background "#fffadf" - ;; ;; :background "#f9f9f9" - ;; :background 'unspecified - ;; ;; :foreground "#809de5" - ;; :foreground "steel blue") - - ;; erc-fill - ;; (setq - ;; erc-fill-column 77 - ;; erc-fill-function 'erc-fill-variable - ;; erc-fill-static-center 18) - ;; to disable: - ;; (erc-fill-mode -1) - - ;; erc-log - (defun b/erc-log-directory (buffer target _nick server _port) - (let ((directory (concat (b/var "erc/logs/") - ;; (or (with-current-buffer buffer - ;; (symbol-name erc-network)) - ;; server) - server - (if (erc-server-buffer-p buffer) - (concat "/" server) - (and target (concat "/" target)))))) - (unless (file-exists-p directory) - (make-directory directory 'make-parents)) - directory)) - (defun b/erc-log-file-name (&rest _) - (concat (format-time-string "%Y-%m-%d") ".log")) - (setq - ;; erc-enable-logging 'erc-log-all-but-server-buffers - erc-generate-log-file-name-function #'b/erc-log-file-name - erc-log-channels-directory #'b/erc-log-directory - erc-log-file-coding-system 'utf-8 - erc-log-write-after-insert t - erc-log-write-after-send t - erc-save-buffer-on-part nil - erc-save-queries-on-quit nil) - - (with-eval-after-load 'erc-match - (setq - erc-pal-highlight-type 'nick - erc-pals - '("bremner" "^gopar" "^iank" "quidam" "^rwp" "sudoman" - "technomancy" "thomzane")) - (set-face-attribute - 'erc-pal-face nil - :foreground 'unspecified - :weight 'unspecified - :inherit 'erc-nick-default-face - ;; :background (face-attribute 'font-lock-string-face :background) - :background "#ffffdf")) - - (with-eval-after-load 'erc-pcomplete - (setq erc-pcomplete-nick-postfix ",") - ;; for matterircd nick (username) completions - ;; (advice-add - ;; #'pcomplete-erc-nicks - ;; :around - ;; (lambda (orig-fun &rest args) - ;; (let ((nicks (apply orig-fun args))) - ;; (if (string-match-p "matterircd" (symbol-name (erc-network))) - ;; (mapcar (lambda (nick) (concat "@" nick)) nicks) - ;; nicks)))) - ) - - (with-eval-after-load 'erc-stamp - (setq erc-timestamp-only-if-changed-flag nil - erc-timestamp-format "%T " - erc-insert-timestamp-function 'erc-insert-timestamp-left)) - (with-eval-after-load 'erc-match - (set-face-attribute - 'erc-timestamp-face nil - :foreground "#aaaaaa" - :weight 'unspecified - :background 'unspecified)) - - (with-eval-after-load 'erc-track - (setq - erc-track-enable-keybindings nil - erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT" - "324" "329" "332" "333" "353" "477") - erc-track-position-in-mode-line t - erc-track-priority-faces-only 'all - erc-track-shorten-function nil - erc-track-showcount t)) - - (declare-function erc-update-modules "erc") - (erc-update-modules) - - ;; key bindings - (global-set-key (kbd "C-c w e") #'erc-switch-to-buffer-other-window) - (define-key erc-mode-map (kbd "M-a") #'erc-track-switch-buffer)) - -;; global key bindings -(global-set-key - (kbd "C-c e l") - (lambda () - (interactive) - (erc-tls :server "irc.libera.chat" :port 6697 - :client-certificate t))) -(global-set-key - (kbd "C-c e o") - (lambda () - (interactive) - (erc-tls :server "irc.oftc.net" :port 6697 - :client-certificate t))) -(global-set-key - (kbd "C-c e t") - (lambda () - (interactive) - (erc-tls :server "na.tilde.chat" :port 6697 - :client-certificate t))) - -;; (global-set-key -;; (kbd "C-c e c") -;; (lambda () -;; (interactive) -;; (erc :server "localhost" :port 6667 -;; :id 'matterircd-canonical))) - -(provide 'bandali-erc) -;;; bandali-erc.el ends here diff --git a/.emacs.d/lisp/bandali-eshell.el b/.emacs.d/lisp/bandali-eshell.el deleted file mode 100644 index 7bf3b4f..0000000 --- a/.emacs.d/lisp/bandali-eshell.el +++ /dev/null @@ -1,97 +0,0 @@ -;;; bandali-eshell.el --- bandali's Eshell setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2018-2022 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: processes - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My awesome Eshell setup. - -;;; Code: - -(with-eval-after-load 'eshell - (make-directory (b/etc "eshell/") t) - (setq - eshell-aliases-file (b/etc "eshell/aliases") - eshell-directory-name (b/var "eshell/") - eshell-hist-ignoredups t - eshell-input-filter #'eshell-input-filter-initial-space - ;; eshell-prompt-regexp "\\(.*\n\\)*[$#] " - ;; eshell-prompt-function - ;; (lambda () - ;; (concat - ;; (propertize (format "%s@%s:" (user-login-name) (system-name)) - ;; 'face 'default) - ;; (propertize (abbreviate-file-name default-directory) - ;; 'face 'font-lock-comment-face) - ;; (propertize "\n" 'face 'default) - ;; (if (= (user-uid) 0) - ;; (propertize "#" 'face 'red) - ;; (propertize "$" 'face 'default)) - ;; (propertize " " 'face 'default))) - eshell-prompt-regexp "^[^#$\n]* [#$] ; " - eshell-prompt-function - (lambda () - (concat ": " - (system-name) - ":" - (abbreviate-file-name (eshell/pwd)) - (unless (eshell-exit-success-p) - (format " [%d]" eshell-last-command-status)) - (if (= (file-user-uid) 0) " # " " $ ") - "; "))) - (eval-when-compile - (defvar eshell-prompt-regexp) - (declare-function eshell-life-is-too-much "esh-mode") - (declare-function eshell-send-input "esh-mode" - (&optional use-region queue-p no-newline))) - (defun b/eshell-quit-or-delete-char (arg) - (interactive "p") - (if (and (eolp) (looking-back eshell-prompt-regexp nil)) - (eshell-life-is-too-much) - (delete-char arg))) - (defun b/eshell-clear () - (interactive) - (let ((inhibit-read-only t)) - (erase-buffer)) - (eshell-send-input)) - (defun b/eshell-history () - (interactive) - (completing-read "Eshell history: " - (ring-elements eshell-history-ring))) - (defun b/eshell-setup () - (make-local-variable 'company-idle-delay) - (defvar company-idle-delay) - (eval-when-compile - (defvar eshell-mode-map) - (defvar eshell-hist-mode-map)) - (setq company-idle-delay nil) - ;; local key bindings - (define-key eshell-mode-map (kbd "C-d") - #'b/eshell-quit-or-delete-char) - (define-key eshell-mode-map (kbd "C-S-l") - #'b/eshell-clear) - (define-key eshell-hist-mode-map (kbd "M-r") - #'b/eshell-history))) -;; global key bindings -(global-set-key (kbd "C-c s e") #'eshell) -;; hooks -(add-hook 'eshell-mode-hook #'b/eshell-setup) - -(provide 'bandali-eshell) -;;; bandali-eshell.el ends here diff --git a/.emacs.d/lisp/bandali-exwm.el b/.emacs.d/lisp/bandali-exwm.el deleted file mode 100644 index e7f83ce..0000000 --- a/.emacs.d/lisp/bandali-exwm.el +++ /dev/null @@ -1,352 +0,0 @@ -;;; bandali-exwm.el --- bandali's EXWM configuration -*- lexical-binding: t; -*- - -;; Copyright (c) 2018-2023 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: tools - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My EXWM setup. Makes good use of its simulation keys. - -;;; Code: - -(add-to-list 'load-path (b/lisp "xelb")) -(add-to-list 'load-path (b/lisp "exwm")) -(require 'exwm) -;; (setq exwm-replace t) -;; make class name the buffer name, truncating beyond 60 characters -(defun b/exwm-rename-buffer () - (interactive) - (exwm-workspace-rename-buffer - (concat exwm-class-name ":" - (if (<= (length exwm-title) 60) exwm-title - (concat (substring exwm-title 0 59) "..."))))) -;; Enable EXWM -(exwm-enable) -(add-hook 'exwm-update-class-hook #'b/exwm-rename-buffer) -(add-hook 'exwm-update-title-hook #'b/exwm-rename-buffer) - -(require 'exwm-config) -(add-hook 'exwm-init-hook #'exwm-config--fix/ido-buffer-window-other-frame) - -(require 'exwm-input) -(defun b/exwm-ws-prev-index () - "Return the index for the previous EXWM workspace, wrapping -around if needed." - (if (= exwm-workspace-current-index 0) - (1- exwm-workspace-number) - (1- exwm-workspace-current-index))) - -(defun b/exwm-ws-next-index () - "Return the index for the next EXWM workspace, wrapping -around if needed." - (if (= exwm-workspace-current-index - (1- exwm-workspace-number)) - 0 - (1+ exwm-workspace-current-index))) - -(defun b/exwm-ws-prev () - "Switch to previous EXWM workspace, wrapping around if needed." - (interactive) - (exwm-workspace-switch-create - (b/exwm-ws-prev-index))) - -(defun b/exwm-ws-next () - "Switch to next EXWM workspace, wrapping around if needed." - (interactive) - (exwm-workspace-switch-create - (b/exwm-ws-next-index))) - -;; shorten 'C-c C-q' to 'C-q' -(define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key) - -;; scroll up/down/left/right on the echo area -(define-key minibuffer-inactive-mode-map [mouse-4] #'b/exwm-ws-prev) -(define-key minibuffer-inactive-mode-map [mouse-5] #'b/exwm-ws-next) -(define-key minibuffer-inactive-mode-map [mouse-6] #'b/exwm-ws-prev) -(define-key minibuffer-inactive-mode-map [mouse-7] #'b/exwm-ws-next) - -(defvar b/shifted-ws-names - '(0 \) 1 \! 2 \@ 3 \# 4 \$ - 5 \% 6 \^ 7 \& 8 \* 9 \() - "Mapping of shifted numbers on my keyboard.") - -(setq - exwm-workspace-number 10 - exwm-input-global-keys - `(([?\s-R] . exwm-reset) - ;; ([?\s-b] . exwm-workspace-switch-to-buffer) - ([?\s-/] . exwm-workspace-switch) - ([?\s-\s] . dmenu) - ([?\s-\\] . (lambda () - (interactive) - (start-process-shell-command - "passmenu" nil "passmenu --type"))) - ([?\S-\s-\s] . (lambda (command) - (interactive - (list (read-shell-command "➜ "))) - (start-process-shell-command - command nil command))) - ([s-return] . (lambda () - (interactive) - (start-process "" nil "xterm"))) - ([S-s-return] . (lambda () - (interactive) - (start-process "" nil "xterm" - "-name" "floating"))) - ([?\C-\s-\s] . counsel-linux-app) - ([?\s-h] . windmove-left) - ([?\s-j] . windmove-down) - ([?\s-k] . windmove-up) - ([?\s-l] . windmove-right) - ([?\s-H] . windmove-swap-states-left) - ([?\s-J] . windmove-swap-states-down) - ([?\s-K] . windmove-swap-states-up) - ([?\s-L] . windmove-swap-states-right) - ([?\s-N ?d] . (lambda () - (interactive) - (start-process - "" nil "dunstctl" "close"))) - ([?\s-N ?D] . (lambda () - (interactive) - (start-process - "" nil "dunstctl" "close-all"))) - ([?\s-N ?h] . (lambda () - (interactive) - (start-process - "" nil "dunstctl" "history-pop"))) - ([?\s-N return] . (lambda () - (interactive) - (start-process - "" nil "dunstctl" "context"))) - ([?\M-\s-h] . shrink-window-horizontally) - ([?\M-\s-l] . enlarge-window-horizontally) - ([?\M-\s-k] . shrink-window) - ([?\M-\s-j] . enlarge-window) - ([?\s-\[] . b/exwm-ws-prev) - ([?\s-\]] . b/exwm-ws-next) - ([mode-line mouse-4] . b/exwm-ws-prev) ; up - ([mode-line mouse-5] . b/exwm-ws-next) ; down - ([mode-line mouse-6] . b/exwm-ws-prev) ; left - ([mode-line mouse-7] . b/exwm-ws-next) ; right - ([?\s-{] . (lambda () - (interactive) - (exwm-workspace-move-window - (b/exwm-ws-prev-index)))) - ([?\s-}] . (lambda () - (interactive) - (exwm-workspace-move-window - (b/exwm-ws-next-index)))) - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () - (interactive) - (exwm-workspace-switch-create ,i)))) - (number-sequence 0 (1- exwm-workspace-number))) - ,@(mapcar - (lambda (i) - `(,(kbd (format "s-%s" - (plist-get b/shifted-ws-names i))) - . - (lambda () - (interactive) - (exwm-workspace-move-window ,i)))) - (number-sequence 0 (1- exwm-workspace-number))) - ([?\s-.] . exwm-floating-toggle-floating) - ([?\s-f] . exwm-layout-toggle-fullscreen) - ([?\s-W] . (lambda () - (interactive) - (kill-buffer (current-buffer)))) - ([?\s-Q] . (lambda () - (interactive) - (exwm-manage--kill-client))) - ([?\s-\'] . (lambda () - (interactive) - (start-process-shell-command - "dmneu-light" nil "dmenu-light"))) - ([?\s-\;] . (lambda () - (interactive) - (start-process-shell-command - "dmneu-pamixer" nil "dmenu-pamixer") - (b/volume-update))) - ([XF86AudioMute] . ; borken on my X200 :-( - (lambda () - (interactive) - (start-process "" nil "pamixer" "--toggle-mute") - (b/volume-update))) - ([\s-XF86AudioMute] . ; toggle mic mute - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--default-source" "--toggle-mute") - (b/volume-update))) - ([XF86Launch1] . - (lambda () - (interactive) - (start-process "" nil "pamixer" "--toggle-mute") - (b/volume-update))) - ([\s-XF86Launch1] . ; toggle mic mute - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--default-source" "--toggle-mute") - (b/volume-update))) - ([XF86AudioLowerVolume] . - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--allow-boost" "--decrease" "5") - (b/volume-update))) - ([XF86AudioRaiseVolume] . - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--allow-boost" "--increase" "5") - (b/volume-update))) - ([\s-XF86AudioLowerVolume] . - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--default-source" "--decrease" "5") - (b/volume-update))) - ([\s-XF86AudioRaiseVolume] . - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--default-source" "--increase" "5") - (b/volume-update))) - ([XF86AudioPlay] . - (lambda () - (interactive) - (start-process "" nil "mpc" "toggle"))) - ([XF86AudioPrev] . - (lambda () - (interactive) - (start-process "" nil "mpc" "prev"))) - ([XF86AudioNext] . - (lambda () - (interactive) - (start-process "" nil "mpc" "next"))) - ([XF86MonBrightnessDown] . - (lambda () - (interactive) - (start-process "" nil "light" "-U" "5"))) - ([XF86MonBrightnessUp] . - (lambda () - (interactive) - (start-process "" nil "light" "-A" "5"))) - ([XF86ScreenSaver] . - (lambda () - (interactive) - (start-process "" nil "dm-tool" "lock"))) - ([\s-XF86Back] . previous-buffer) - ([\s-XF86Forward] . next-buffer))) - -;; Line-editing shortcuts -(setq - exwm-input-simulation-keys - '(;; movement - ([?\C-b] . [left]) - ([?\M-b] . [C-left]) - ([?\C-f] . [right]) - ([?\M-f] . [C-right]) - ([?\C-p] . [up]) - ([?\C-n] . [down]) - ([?\C-a] . [home]) - ([?\C-e] . [end]) - ([?\M-v] . [prior]) - ([?\C-v] . [next]) - ([?\C-d] . [delete]) - ([?\C-k] . [S-end ?\C-x]) - ([?\M-<] . C-home) - ([?\M->] . C-end) - ;; cut/copy/paste - ([?\C-w] . [?\C-x]) - ([?\M-w] . [?\C-c]) - ([?\C-y] . [?\C-v]) - ([?\M-d] . [C-S-right ?\C-x]) - ([?\M-\d] . [C-S-left ?\C-x]) - ;; window - ([?\s-w] . [?\C-w]) - ([?\s-q] . [?\C-q]) - ;; misc - ([?\C-s] . [?\C-f]) - ([?\s-g] . [?\C-g]) - ([?\s-s] . [?\C-s]) - ([?\C-g] . [escape]) - ([?\C-/] . [?\C-z]))) - -(require 'exwm-manage) -(setq - exwm-manage-configurations - '(((equal exwm-instance-name "floating") - floating t - floating-mode-line nil))) -(add-hook 'exwm-manage-finish-hook - (lambda () - (when exwm-class-name - (cond - ((member exwm-class-name '("Abrowser" "IceCat" "Iceweasel")) - (exwm-input-set-local-simulation-keys - `(,@exwm-input-simulation-keys - ([?\C-\S-d] . [?\C-d])))) - ((member exwm-class-name '("XTerm" "Mate-terminal")) - (exwm-input-set-local-simulation-keys - '(([?\C-c ?\C-c] . [?\C-c]) - ([?\C-c ?\C-u] . [?\C-u])))) - ((string= exwm-class-name "Zathura") - (exwm-input-set-local-simulation-keys - '(([?\C-p] . [C-up]) - ([?\C-n] . [C-down])))))))) - -(require 'exwm-randr) -(setq - exwm-randr-workspace-monitor-plist - '(0 "eDP-1" - 1 "eDP-1" 2 "eDP-1" 3 "eDP-1" - 4 "eDP-1" 5 "eDP-1" 6 "eDP-1" - 7 "HDMI-1" 8 "HDMI-1" 9 "HDMI-1")) -;; (add-hook -;; 'exwm-randr-screen-change-hook -;; (lambda () -;; (start-process-shell-command -;; "xrandr" nil -;; "xrandr --output HDMI-1 --mode 1280x720 --above eDP-1 --auto"))) -(exwm-randr-enable) - -(require 'exwm-systemtray) -(exwm-systemtray-enable) - -(add-to-list 'load-path (b/lisp "exwm-edit")) -(require 'exwm-edit) - -(with-eval-after-load 'exwm-workspace - (setq exwm-workspace-show-all-buffers t) - (setq-default - mode-line-format - (append - mode-line-format - '((:eval - (format - " [%s]" (number-to-string - exwm-workspace-current-index))))))) - -(with-eval-after-load 'exwm-layout - (setq exwm-layout-show-all-buffers t)) - -(provide 'bandali-exwm) -;;; bandali-exwm.el ends here diff --git a/.emacs.d/lisp/bandali-gnus.el b/.emacs.d/lisp/bandali-gnus.el deleted file mode 100644 index 18c6b2e..0000000 --- a/.emacs.d/lisp/bandali-gnus.el +++ /dev/null @@ -1,430 +0,0 @@ -;;; bandali-gnus.el --- bandali's Gnus setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2018-2024 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: mail, news - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My trusty super awesome Gnus setup. - -;;; Code: - -(defvar b/maildir (expand-file-name "~/mail/")) -(with-eval-after-load 'recentf - (add-to-list 'recentf-exclude b/maildir)) - -(defvar b/gnus-init-file (b/etc "gnus")) - -(eval-when-compile - (progn - (defvar nndraft-directory) - (defvar gnus-read-newsrc-file) - (defvar gnus-save-newsrc-file) - (defvar gnus-gcc-mark-as-read) - (defvar nnmail-split-abbrev-alist))) - -(declare-function article-make-date-line "gnus-art" (date type)) - -(setq - mail-user-agent 'gnus-user-agent - read-mail-command 'gnus - - gnus-select-method '(nnnil "") - gnus-secondary-select-methods - `(,@(when (member (system-name) '("darya" "nostalgia")) - '((nnimap - "canonical" - (nnimap-stream plain) - (nnimap-address "127.0.0.1") - (nnimap-server-port 143) - (nnimap-authenticator plain) - (nnimap-user "bandali@canonical.local")))) - (nnimap - "kelar" - (nnimap-stream plain) - (nnimap-address "127.0.0.1") - (nnimap-server-port 143) - (nnimap-authenticator plain) - (nnimap-user "bandali@kelar.local") - ;; (nnmail-expiry-wait immediate) - (nnmail-expiry-target nnmail-fancy-expiry-target) - (nnmail-fancy-expiry-targets - (("from" ".*" "nnimap+kelar:Archive.%Y")))) - (nnimap - "shemshak" - (nnimap-stream plain) - (nnimap-address "127.0.0.1") - (nnimap-server-port 143) - (nnimap-authenticator plain) - (nnimap-user "bandali@shemshak.local")) - (nnimap - "gnu" - (nnimap-stream plain) - (nnimap-address "127.0.0.1") - (nnimap-server-port 143) - (nnimap-authenticator plain) - (nnimap-user "bandali@gnu.local") - (nnimap-inbox "INBOX") - (nnimap-split-methods 'nnimap-split-fancy) - (nnimap-split-fancy - (| - ;; (: gnus-registry-split-fancy-with-parent) - ;; (: gnus-group-split-fancy "INBOX" t "INBOX") - ;; spam - ("X-Spam_action" "reject" "Junk") - ;; keep debbugs emails in INBOX - (list ".*<\\(.*\\)\\.debbugs\\.gnu\\.org>.*" "INBOX") - ;; list moderation emails - (from ".+-\\(owner\\|bounces\\)@\\(non\\)?gnu\\.org" "listmod") - ;; gnu - (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1") - ("Envelope-To" "emacsconf-donations@gnu.org" "l.emacsconf-donations") - ;; board-eval - (| - (list ".*<.*\\.board-eval\\.fsf\\.org>.*" "l.board-eval") - (from ".*@board-eval\\.fsf\\.org" "l.board-eval")) - ;; fsf - (list ".*<\\(.*\\)\\.fsf\\.org>.*" "l.\\1") - ;; cfarm - (from "cfarm-.*@lists\\.tetaneutral\\.net" "l.cfarm") - ;; debian - (list ".*<\\(.*\\)\\.\\(lists\\|other\\)\\.debian\\.org>.*" "l.\\1") - (list ".*<\\(.*\\)\\.alioth-lists\\.debian\\.net>.*" "l.\\1") - ;; gnus - (list ".*<\\(.*\\)\\.gnus\\.org>.*" "l.\\1") - ;; libreplanet - (list ".*<\\(.*\\)\\.libreplanet\\.org>.*" "l.\\1") - ;; iana (e.g. tz-announce) - (list ".*<\\(.*\\)\\.iana\\.org>.*" "l.\\1") - ;; mailop - (list ".*<\\(.*\\)\\.mailop\\.org>.*" "l.\\1") - ;; sdlu - (list ".*<\\(.*\\)\\.spammers\\.dontlike\\.us>.*" "l.sdlu") - ;; bitfolk - (from ".*@\\(.+\\)?bitfolk\\.com>.*" "bitfolk") - ;; haskell - (list ".*<\\(.*\\)\\.haskell\\.org>.*" "l.\\1") - ;; webmasters - (from "webmasters\\(-comment\\)?@gnu\\.org" "webmasters") - ;; other - (list ".*atreus.freelists.org" "l.atreus") - (list ".*deepspec.lists.cs.princeton.edu" "l.deepspec") - ;; (list ".*haskell-art.we.lurk.org" "l.haskell.art") ;d - ;; (list ".*notmuch.notmuchmail.org" "l.notmuch") ;u - (list ".*dev.lists.parabola.nu" "l.parabola-dev") - ;; ---------------------------------- - ;; legend: (u)nsubscribed | (d)ead - ;; ---------------------------------- - ;; otherwise, leave mail in INBOX - "INBOX"))) - (nnimap - "csc" - (nnimap-stream plain) - (nnimap-address "127.0.0.1") - (nnimap-server-port 143) - (nnimap-authenticator plain) - (nnimap-user "abandali@csclub.uwaterloo.local") - (nnimap-inbox "INBOX") - (nnimap-split-methods 'nnimap-split-fancy) - (nnimap-split-fancy - (| - ;; cron reports and other messages from root - (from "root@\\(.*\\.\\)?csclub\\.uwaterloo\\.ca" "INBOX") - ;; spam - ("X-Spam-Flag" "YES" "Junk") - ;; catch-all - "INBOX"))) - (nnimap - "sfl" - (nnimap-stream plain) - (nnimap-address "127.0.0.1") - (nnimap-server-port 143) - (nnimap-authenticator plain) - (nnimap-user "amin.bandali@savoirfairelinux.local"))) - gnus-message-archive-group "nnimap+gnu:INBOX" - gnus-parameters - '(("l\\.fencepost-users" - (to-address . "fencepost-users@gnu.org") - (to-list . "fencepost-users@gnu.org") - (list-identifier . "\\[Fencepost-users\\]")) - ("l\\.haskell-cafe" - (to-address . "haskell-cafe@haskell.org") - (to-list . "haskell-cafe@haskell.org") - (list-identifier . "\\[Haskell-cafe\\]"))) - ;; nnimap-record-commands t - ;; gnus-large-newsgroup 50 - ;; gnus-process-mark-toggle t - gnus-home-directory (b/var "gnus/") - gnus-directory (concat gnus-home-directory "news/") - message-directory (concat gnus-home-directory "mail/") - nndraft-directory (concat gnus-home-directory "drafts/") - gnus-save-newsrc-file nil - gnus-read-newsrc-file nil - gnus-search-use-parsed-queries t - gnus-interactive-exit nil - gnus-gcc-mark-as-read t) - -(with-eval-after-load 'gnus - (when (version< emacs-version "27") - (with-eval-after-load 'nnmail - (add-to-list - 'nnmail-split-abbrev-alist - '(list . "list-id\\|list-post\\|x-mailing-list\\|x-beenthere\\|x-loop") - t))) - - (setq gnus-user-agent '(emacs gnus type)) - - ;; (require 'gnus-registry) - ;; (setq gnus-registry-max-entries 2500) - ;; (setq gnus-registry-ignored-groups - ;; (append gnus-registry-ignored-groups - ;; '(("^nnimap:gnu\\.l" t) - ;; ("webmasters$" t)))) - ;; (gnus-registry-initialize) - - (with-eval-after-load 'recentf - (add-to-list 'recentf-exclude gnus-home-directory)) - - ;; hooks - (add-hook 'gnus-group-mode-hook #'gnus-topic-mode) - (add-hook 'gnus-group-mode-hook #'gnus-agent-mode)) -;; global key bindings -(global-set-key (kbd "C-c g") #'gnus-plugged) -(global-set-key (kbd "C-c G") #'gnus-unplugged) - -(with-eval-after-load 'gnus-art - (setq - gnus-buttonized-mime-types '("multipart/\\(signed\\|encrypted\\)") - gnus-sorted-header-list '("^From:" - "^X-RT-Originator" - "^Newsgroups:" - "^Subject:" - "^Date:" - "^Envelope-To:" - "^Followup-To:" - "^Reply-To:" - "^Organization:" - "^Summary:" - "^Abstract:" - "^Keywords:" - "^To:" - "^[BGF]?Cc:" - "^Posted-To:" - "^Mail-Copies-To:" - "^Mail-Followup-To:" - "^Apparently-To:" - "^Resent-From:" - "^User-Agent:" - "^X-detected-operating-system:" - "^X-Spam_action:" - "^X-Spam_bar:" - "^Message-ID:" - ;; "^References:" - "^List-Id:" - "^Gnus-Warning:") - gnus-visible-headers (mapconcat #'identity - gnus-sorted-header-list - "\\|")) - ;; local key bindings - (declare-function org-store-link "ol" (arg &optional interactive?)) - (define-key gnus-article-mode-map (kbd "M-L") #'org-store-link)) - -(with-eval-after-load 'gnus-sum - (setq gnus-thread-sort-functions '(gnus-thread-sort-by-number - gnus-thread-sort-by-subject - gnus-thread-sort-by-date)) - (with-eval-after-load 'message - (setq gnus-ignored-from-addresses message-dont-reply-to-names)) - - (defun b/gnus-junk-article (&optional n) - (interactive "P" gnus-summary-mode) - (gnus-summary-move-article - n - (gnus-group-prefixed-name - "Junk" - (gnus-find-method-for-group gnus-newsgroup-name)))) - ;; local key bindings - (define-key gnus-summary-mode-map (kbd "M-L") #'org-store-link) - ;; (define-key gnus-summary-mode-map (kbd "r") - ;; #'gnus-summary-reply-with-original) - ;; (define-key gnus-summary-mode-map (kbd "R") - ;; #'gnus-summary-wide-reply-with-original) - (defvar b/gnus-summary-prefix-map) - (define-prefix-command 'b/gnus-summary-prefix-map) - (define-key - gnus-summary-mode-map (kbd "v") - 'b/gnus-summary-prefix-map) - (define-key - b/gnus-summary-prefix-map (kbd "r r") - #'gnus-summary-very-wide-reply) - (define-key - b/gnus-summary-prefix-map (kbd "r q") - #'gnus-summary-very-wide-reply-with-original) - (define-key - b/gnus-summary-prefix-map (kbd "R r") - #'gnus-summary-reply) - (define-key - b/gnus-summary-prefix-map (kbd "R q") - #'gnus-summary-reply-with-original) - (define-key - b/gnus-summary-prefix-map (kbd "r a w") - #'gnus-summary-show-raw-article) - (define-key - b/gnus-summary-prefix-map (kbd "s") - #'b/gnus-junk-article)) -;; hooks -(add-hook 'gnus-summary-mode-hook #'b/no-mouse-autoselect-window) - -(defvar b/sfl-p nil) -(with-eval-after-load 'gnus-msg - (let ((bandali "Amin Bandali%s - https://www.gnu.ca/~bandali/")) - (defvar b/csc-signature - (mapconcat - #'identity - `(,(format bandali ", MMath") - "Systems Committee " - "Computer Science Club of the University of Waterloo") - "\n")) - (defvar b/sfl-signature - (mapconcat - #'identity - `(,bandali - "Volunteer, Savoir-faire Linux" - "jami:bandali") - "\n") - "")) ; the "" is for bandali's %s - (setq - gnus-message-replysign t - gnus-posting-styles - '((".*" - (address "bandali@gnu.org") - ("X-Message-SMTP-Method" "smtp fencepost.gnu.org 587")) - ((header "subject" "ThankCRM") - (to "webmasters-comment@gnu.org") - (body "")) - ("nnimap\\+kelar:.*" - (address "bandali@kelar.org") - ("X-Message-SMTP-Method" "smtp mail.kelar.org 587") - (gcc "nnimap+kelar:Sent")) - ("nnimap\\+shemshak:.*" - (address "amin@shemshak.org") - ("X-Message-SMTP-Method" "smtp mail.shemshak.org 587") - (gcc "nnimap+shemshak:Sent")) - ("nnimap\\+canonical:.*" - (address "bandali@canonical.com") - ("X-Message-SMTP-Method" "smtp smtp.canonical.com 587") - (signature nil) - (gcc "nnimap+canonical:Sent")) - ((header "to" "amin\\.bandali@canonical\\.com") - (address "amin.bandali@canonical.com")) - ((header "cc" "amin\\.bandali@canonical\\.com") - (address "amin.bandali@canonical.com")) - ("nnimap\\+.*:l\\.ubuntu-.*" - (address "bandali@ubuntu.com") - ("X-Message-SMTP-Method" "smtp mail.kelar.org 587")) - ((header "list-id" ".*\\.lists.ubuntu.com") - (address "bandali@ubuntu.com") - ("X-Message-SMTP-Method" "smtp mail.kelar.org 587")) - ("nnimap\\+csc:.*" - (address "bandali@csclub.uwaterloo.ca") - ("X-Message-SMTP-Method" "smtp mail.csclub.uwaterloo.ca 587") - (signature b/csc-signature) - (gcc "nnimap+csc:Sent")) - ("nnimap\\+sfl:.*" - (address "amin.bandali@savoirfairelinux.com") - ("X-Message-SMTP-Method" "smtp mail.savoirfairelinux.com 587") - (signature b/sfl-signature) - (eval (setq-local b/sfl-p t)) - (gcc "nnimap+sfl:Sent"))))) -;; hooks -;; (with-eval-after-load 'gnus -;; (add-hook 'gnus-message-setup-hook -;; (lambda () -;; (unless (or (mml-secure-is-encrypted-p) -;; b/sfl-p) -;; (mml-secure-message-sign))))) - -(with-eval-after-load 'gnus-topic - (setq - gnus-topic-line-format "%i[ %A: %(%{%n%}%) ]%v\n" - gnus-topic-topology - `(("Gnus" visible nil nil) - (("misc" visible nil nil)) - ,@(when (member (system-name) '("darya" "nostalgia")) - '((("canonical" visible nil nil)))) - (("csc" visible nil nil)) - (("kelar" visible nil nil)) - (("shemshak" visible nil nil)) - (("gnu" visible nil nil)) - ;(("old-gnu" visible nil nil)) - (("sfl" visible nil nil))))) - -(with-eval-after-load 'gnus-agent - (setq gnus-agent-synchronize-flags 'ask)) - -(with-eval-after-load 'gnus-group - (setq gnus-permanently-visible-groups "\\(:INBOX$\\|:gnu$\\)")) - -(with-eval-after-load 'gnus-win - (setq gnus-use-full-window nil)) - -(with-eval-after-load 'gnus-dired - (add-hook 'dired-mode-hook 'gnus-dired-mode)) - -(with-eval-after-load 'mm-archive - (add-to-list - 'mm-archive-decoders - '("application/gzip" nil "gunzip" "-S" ".zip" "-kd" "%f" "-r"))) - -(with-eval-after-load 'gnus-start - (add-hook 'gnus-after-getting-new-news-hook #'gnus-notifications)) - -(with-eval-after-load 'mm-decode - (setq - ;; mm-attachment-override-types `("text/x-diff" "text/x-patch" - ;; ,@mm-attachment-override-types) - mm-discouraged-alternatives '("text/html" "text/richtext") - mm-decrypt-option 'known - mm-verify-option 'known) - (add-to-list - 'mm-inline-media-tests - `("application/gzip" mm-archive-dissect-and-inline identity)) - (add-to-list 'mm-inlined-types "application/gzip" 'append)) - -(with-eval-after-load 'mm-uu - (when (version< "27" emacs-version) - (set-face-attribute 'mm-uu-extract nil :extend t)) - (when (version< emacs-version "27") - (setq mm-uu-diff-groups-regexp "."))) - -(with-eval-after-load 'mml - (setq - mml-attach-file-at-the-end t - mml-content-disposition-alist - '((text - (markdown . "attachment") - (rtf . "attachment") - (t . "inline")) - (t. "attachment")))) - -(with-eval-after-load 'mml-sec - (setq mml-secure-openpgp-encrypt-to-self t - mml-secure-openpgp-sign-with-sender t)) - -(provide 'bandali-gnus) -;;; bandali-gnus.el ends here diff --git a/.emacs.d/lisp/bandali-ibuffer.el b/.emacs.d/lisp/bandali-ibuffer.el deleted file mode 100644 index a706dc6..0000000 --- a/.emacs.d/lisp/bandali-ibuffer.el +++ /dev/null @@ -1,110 +0,0 @@ -;;; bandali-ibuffer.el --- bandali's Ibuffer setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2018-2022 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: tools - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My Ibuffer setup. - -;;; Code: - -(setq - ibuffer-saved-filter-groups - '(("default" - ("dired" (mode . dired-mode)) - ("org" (mode . org-mode)) - ("gnus" - (or - (mode . gnus-group-mode) - (mode . gnus-summary-mode) - (mode . gnus-article-mode) - (mode . message-mode))) - ("web" - (or - (mode . mhtml-mode) - (mode . css-mode) - (mode . scss-mode) - (mode . js2-mode))) - ("shell" - (or - (mode . eshell-mode) - (mode . shell-mode) - (mode . term-mode))) - ("programming" - (or - (mode . python-mode) - (mode . c-mode) - (mode . c++-mode) - (mode . java-mode) - (mode . emacs-lisp-mode) - (mode . scheme-mode) - (mode . haskell-mode) - (mode . lean-mode) - ;; (mode . go-mode) - (mode . alloy-mode))) - ("tex" - (or - (mode . bibtex-mode) - (mode . latex-mode))) - ("emacs" - (or - (name . "^\\*scratch\\*$") - (name . "^\\*Messages\\*$"))) - ("exwm" (mode . exwm-mode)) - ("erc" (mode . erc-mode)))) - ibuffer-formats - '((mark modified read-only locked " " - (name 72 72 :left :elide) - " " - (size-h 9 -1 :right) - " " - (mode 16 16 :left :elide) - " " filename-and-process) - (mark " " - (name 16 -1) - " " filename))) -(with-eval-after-load 'ibuffer - ;; Use human readable Size column instead of original one - (define-ibuffer-column size-h - (:name "Size" :inline t) - (cond - ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0))) - ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0))) - ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0))) - (t (format "%8d" (buffer-size))))) - - ;; local key bindings - (define-key ibuffer-mode-map (kbd "P") - #'ibuffer-backward-filter-group) - (define-key ibuffer-mode-map (kbd "N") - #'ibuffer-forward-filter-group) - (define-key ibuffer-mode-map (kbd "M-p") - #'ibuffer-do-print) - (define-key ibuffer-mode-map (kbd "M-n") - #'ibuffer-do-shell-command-pipe-replace)) -;; global key bindings -(global-set-key (kbd "C-x C-b") #'ibuffer) -;; hooks -(declare-function ibuffer-switch-to-saved-filter-groups "ibuf-ext" - (name)) -(add-hook 'ibuffer-hook - (lambda () (ibuffer-switch-to-saved-filter-groups "default"))) - -(provide 'bandali-ibuffer) -;;; bandali-ibuffer.el ends here diff --git a/.emacs.d/lisp/bandali-message.el b/.emacs.d/lisp/bandali-message.el deleted file mode 100644 index f9f0873..0000000 --- a/.emacs.d/lisp/bandali-message.el +++ /dev/null @@ -1,110 +0,0 @@ -;;; bandali-message.el --- bandali's message.el setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2018-2022 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: mail, news - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My setup for message.el. - -;;; Code: - -(with-eval-after-load 'message - ;; :bind (:map message-mode-map ("" . b/insert-asterism)) - ;; redefine for a simplified In-Reply-To header - ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67) - (defun message-make-in-reply-to () - "Return the In-Reply-To header for this message." - (when message-reply-headers - (let ((from (mail-header-from message-reply-headers)) - (msg-id (mail-header-id message-reply-headers))) - (when from - msg-id)))) - - (defconst b/message-cite-style-format "On %Y-%m-%d %l:%M %p, %N wrote:") - (defconst message-cite-style-bandali - '((message-cite-function 'message-cite-original) - (message-citation-line-function 'message-insert-formatted-citation-line) - (message-cite-reply-position 'traditional) - (message-yank-prefix "> ") - (message-yank-cited-prefix ">") - (message-yank-empty-prefix ">") - (message-citation-line-format b/message-cite-style-format)) - "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.") - (setq - message-elide-ellipsis "[...]\n" - ;; message-cite-style 'message-cite-style-bandali - message-citation-line-format "%N writes:\n" - ;; message-citation-line-format "On %a, %d %b %Y, %N wrote:\n" - message-citation-line-function 'message-insert-formatted-citation-line - message-confirm-send t - message-fill-column 70 - message-forward-as-mime t - message-kill-buffer-on-exit t - message-send-mail-function #'smtpmail-send-it - message-subscribed-address-functions - '(gnus-find-subscribed-addresses) - message-dont-reply-to-names - (mapconcat - #'identity - '("\\(bandali\\|mab\\|aminb?\\)@gnu\\.org" - "bandali@kelar\\.org" - "amin@shemshak\\.org" - "a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca" - "amin\\.bandali@savoirfairelinux\\.com" - "\\(amin\\.\\)?bandali@canonical\\.com" - "bandali@ubuntu\\.com") - "\\|")) - ;; (custom-set-faces - ;; '(message-header-subject - ;; ((t (:foreground "#111" :weight semi-bold)))) - ;; '(message-header-to - ;; ((t (:foreground "#111" :weight normal)))) - ;; '(message-header-cc - ;; ((t (:foreground "#333" :weight normal)))) - - ;; custom newline & reformat function - (defun b/message-newline-or-asterism (arg) - "Create newlines per my liking or insert asterism if ARG is -non-nil." - (interactive "P") - (if arg - (b/insert-asterism) - (progn - (beginning-of-line) - (delete-region (point) (line-end-position)) - (newline) - (open-line 1)))) - (define-key message-mode-map - (kbd "M-RET") #'b/message-newline-or-asterism) - - ;; local key bindings - ;; (define-key message-mode-map - ;; [remap next-line] #'mail-abbrev-next-line) - ;; (define-key message-mode-map - ;; [remap end-of-buffer] #'mail-abbrev-end-of-buffer) - ) -;; hooks -;; (add-hook 'message-setup-hook #'mml-secure-message-sign-pgpmime) -(add-hook 'message-mode-hook #'flyspell-mode) -(add-hook 'message-mode-hook - (lambda () - (local-unset-key (kbd "C-c C-s")))) - -(provide 'bandali-message) -;;; bandali-message.el ends here diff --git a/.emacs.d/lisp/bandali-org.el b/.emacs.d/lisp/bandali-org.el deleted file mode 100644 index bdaff4e..0000000 --- a/.emacs.d/lisp/bandali-org.el +++ /dev/null @@ -1,125 +0,0 @@ -;;; bandali-org.el --- bandali's Org setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2018-2022 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: calendar, data, docs, hypermedia, outlines - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My set up for Org (org-mode) and all things Org. - -;;; Code: - -;; (setq org--inhibit-version-check t) - -(with-eval-after-load 'org - (setq - org-src-tab-acts-natively t - org-src-preserve-indentation nil - org-edit-src-content-indentation 0 - org-id-locations-file (b/var "org/id-locations.el") - org-link-email-description-format "Email %c: %s" ; %.30s - org-highlight-latex-and-related '(entities) - org-use-speed-commands t - org-startup-folded 'content - org-catch-invisible-edits 'show-and-error - org-log-done 'time - org-pretty-entities t - org-agenda-files '("~/usr/org/todos/personal.org" - "~/usr/org/todos/habits.org" - "~/src/git/masters-thesis/todo.org") - org-agenda-start-on-weekday 0 - org-agenda-time-leading-zero t - org-habit-graph-column 44 - org-latex-packages-alist '(("" "listings") ("" "color"))) - (add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t) - (add-to-list 'org-modules 'org-habit) - (custom-set-faces - '(org-latex-and-related ((t (:foreground "#b294bb"))))) - ;; local key bindings - (define-key org-mode-map (kbd "M-L") #'org-insert-last-stored-link) - (define-key org-mode-map (kbd "M-O") #'org-toggle-link-display) - ;; hooks - ;; `org-indent-mode' doesn't seem to play nice with - ;; `display-fill-column-indicator'. - ;; (add-hook 'org-mode-hook #'org-indent-mode) - (add-hook 'org-mode-hook #'auto-fill-mode) - (add-hook 'org-mode-hook #'flyspell-mode) - - ;; additional export backends - (require 'ox-md) - - ;; asynchronous tangle, using emacs-async to asynchronously tangle an - ;; org file. closely inspired by - ;; https://github.com/dieggsy/dotfiles/tree/cc10edf7701958eff1cd94d4081da544d882a28c/emacs.d#dotfiles - (defvar b/show-async-tangle-results nil - "Keep *emacs* async buffers around for later inspection.") - - (defvar b/show-async-tangle-time nil - "Show the time spent tangling the file.") - - (defun b/async-babel-tangle () - "Tangle org file asynchronously." - (interactive) - (let* ((file-tangle-start-time (current-time)) - (file (buffer-file-name)) - (file-nodir (file-name-nondirectory file)) - ;; (async-quiet-switch "-q") - ;; (file-noext (file-name-sans-extension file)) - ) - (async-start - `(lambda () - (require 'org) - (org-babel-tangle-file ,file)) - (unless b/show-async-tangle-results - `(lambda (result) - (if result - (message "Tangled %s%s" - ,file-nodir - (if b/show-async-tangle-time - (format " (%.3fs)" - (float-time (time-subtract (current-time) - ',file-tangle-start-time))) - "")) - (message "Tangling %s failed" ,file-nodir))))))) - (add-to-list - 'safe-local-variable-values - '(eval add-hook 'after-save-hook #'b/async-babel-tangle 'append 'local))) -;; global key bindings -(global-set-key (kbd "C-c a o a") #'org-agenda) - -(with-eval-after-load 'ox-latex - (setq - org-latex-listings 'listings - ;; org-latex-prefer-user-labels t - ) - (add-to-list 'org-latex-classes - '("IEEEtran" "\\documentclass[11pt]{IEEEtran}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) - t) - (require 'ox-beamer)) - -(with-eval-after-load 'ox-extra - (declare-function ox-extras-activate "ox-extra" (extras)) - (ox-extras-activate '(latex-header-blocks ignore-headlines))) - -(provide 'bandali-org) -;;; bandali-org.el ends here diff --git a/.emacs.d/lisp/bandali-po.el b/.emacs.d/lisp/bandali-po.el deleted file mode 100644 index a31fee2..0000000 --- a/.emacs.d/lisp/bandali-po.el +++ /dev/null @@ -1,61 +0,0 @@ -;;; bandali-po.el --- bandali's po-mode setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2021 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: i18n gettext - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My po-mode setup for editing PO translation files in GNU Emacs. - -;;; Code: - -(with-eval-after-load 'po-mode - ;; based on the `po-wrap' function from the GNUN manual: - ;; https://www.gnu.org/s/trans-coord/manual/gnun/html_node/Wrapping-Long-Lines.html - (defun b/po-wrap () - "Run the current `po-mode' buffer through `msgcat' to wrap all -lines." - (interactive) - (when (eq major-mode 'po-mode) - (let ((tmp-file (make-temp-file "po-wrap.")) - (tmp-buffer (generate-new-buffer "*temp*"))) - (unwind-protect - (progn - (write-region (point-min) (point-max) tmp-file nil 1) - (if (zerop - (call-process "msgcat" nil tmp-buffer t - (shell-quote-argument tmp-file))) - (let ((saved (point)) - (inhibit-read-only t)) - (delete-region (point-min) (point-max)) - (insert-buffer-substring tmp-buffer) - (goto-char (min saved (point-max)))) - (with-current-buffer tmp-buffer - (error (buffer-string))))) - (kill-buffer tmp-buffer) - (delete-file tmp-file))))) - - (add-hook 'po-mode-hook (lambda nil (run-with-timer 0.1 nil 'View-exit))) - (define-key po-mode-map (kbd "M-q") #'b/po-wrap)) - -(autoload #'po-mode "po-mode" - "Major mode for editing PO translation files" t) -(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) - -(provide 'bandali-po) -;;; bandali-po.el ends here diff --git a/.emacs.d/lisp/bandali-theme.el b/.emacs.d/lisp/bandali-theme.el deleted file mode 100644 index fa5911c..0000000 --- a/.emacs.d/lisp/bandali-theme.el +++ /dev/null @@ -1,79 +0,0 @@ -;;; bandali-theme.el --- bandali's custom theme setup -*- lexical-binding: t; -*- - -;; Copyright (C) 2018-2020 Amin Bandali - -;; Author: Amin Bandali -;; Keywords: faces - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My custom theme setup. - -;;; Code: - -(when (display-graphic-p) - (add-to-list 'load-path (b/lisp "refinery-theme")) - (with-eval-after-load 'package - (require 'refinery-theme) - (load-theme 'refinery t))) - -;; (require 'smart-mode-line) -;; ;; thanks, but no thanks; don't make fixed-width fills. -;; (defun sml/fill-for-buffer-identification nil "") -;; (setq sml/theme 'respectful) -;; (let ((sml/no-confirm-load-theme t)) -;; (sml/setup) -;; (smart-mode-line-enable)) - -;; (require 'minions) -;; (minions-mode) - -(defvar b/org-mode-font-lock-keywords - '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)" - (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive - (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind - (4 '(:foreground "#c5c8c6") t))) ; title - "For use with the `doom-tomorrow-night' theme.") - -(eval-when-compile - (declare-function exwm-systemtray--refresh "exwm-systemtray") - (declare-function erc-hl-nicks-reset-face-table "erc-hl-nicks")) - -(defun b/lights-on () - "Enable my favourite light theme." - (interactive) - (mapc #'disable-theme custom-enabled-themes) - (load-theme 'refinery t) - (font-lock-remove-keywords - 'org-mode b/org-mode-font-lock-keywords) - (when (featurep 'exwm-systemtray) - (exwm-systemtray--refresh))) - -(defun b/lights-off () - "Go dark." - (interactive) - (mapc #'disable-theme custom-enabled-themes) - (load-theme 'refinery-dark t) - (font-lock-add-keywords - 'org-mode b/org-mode-font-lock-keywords t) - (when (featurep 'exwm-systemtray) - (exwm-systemtray--refresh))) - -(global-set-key (kbd "C-c t d") #'b/lights-off) -(global-set-key (kbd "C-c t l") #'b/lights-on) - -(provide 'bandali-theme) -;;; bandali-theme.el ends here -- cgit v1.2.3-60-g2f50