From 78d731e133fcef8464acb1d0eb8a51864d0189cd Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Thu, 19 May 2022 20:30:15 -0400 Subject: [PATCH] Drop `csetq' macro and use good old `setq' and `setq-default'. --- .emacs.d/init.el | 171 +++++++-------- .emacs.d/lisp/bandali-dired.el | 23 +- .emacs.d/lisp/bandali-erc.el | 20 +- .emacs.d/lisp/bandali-eshell.el | 4 +- .emacs.d/lisp/bandali-exwm.el | 354 ++++++++++++++++--------------- .emacs.d/lisp/bandali-gnus.el | 39 ++-- .emacs.d/lisp/bandali-ibuffer.el | 4 +- .emacs.d/lisp/bandali-message.el | 10 +- .emacs.d/lisp/bandali-org.el | 46 ++-- 9 files changed, 326 insertions(+), 345 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 32989b0..0fd70e5 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,6 +1,6 @@ ;;; init.el --- bandali's emacs configuration -*- lexical-binding: t -*- -;; Copyright (C) 2018-2021 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; 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 @@ -103,26 +103,6 @@ user-mail-address "bandali@gnu.org") -;;; csetq (`custom' setq) - -(require 'cl-lib) - -(defmacro csetq (&rest args) - "Set the value of user option VAR to VALUE. - -More generally, you can use multiple variables and values, as in - (csetq VAR VALUE VAR VALUE...) -This sets each user option VAR's value to the corresponding VALUE. - -\(fn [VAR VALUE]...)" - (declare (debug setq)) - `(progn - ,@(cl-loop for (var value) on args by 'cddr - collect - `(funcall (or (get ',var 'custom-set) #'set-default) - ',var ,value)))) - - ;;; Package management ;; variables of interest: @@ -135,7 +115,7 @@ This sets each user option VAR's value to the corresponding VALUE. ;; (package-generate-description-file d "refinery-theme-pkg.el")) (run-with-idle-timer 0.01 nil #'require 'package) (with-eval-after-load 'package - ;; (csetq + ;; (setq ;; ;; package-archives ;; ;; `(,@package-archives ;; ;; ("bndl" . "https://p.bndl.org/elpa/")) @@ -149,7 +129,7 @@ This sets each user option VAR's value to the corresponding VALUE. ;; (yasnippet "0.14.0"))) (package-initialize)) -(csetq package-archive-upload-base "/ssh:caffeine:~/www/p/elpa") +(setq package-archive-upload-base "/ssh:caffeine:~/www/p/elpa") ;;; Initial setup @@ -177,7 +157,7 @@ This sets each user option VAR's value to the corresponding VALUE. "Expand filename FILE relative to `b/lisp-dir'." (expand-file-name (convert-standard-filename file) b/lisp-dir)) -(csetq +(setq auto-save-list-file-prefix (b/var "auto-save/sessions/") nsm-settings-file (b/var "nsm-settings.el")) @@ -212,7 +192,7 @@ This sets each user option VAR's value to the corresponding VALUE. ;;;; C-level customizations -(csetq +(setq ;; line-spacing 3 ;; completion case sensitivity completion-ignore-case t @@ -273,25 +253,19 @@ This sets each user option VAR's value to the corresponding VALUE. ;; (define-key icomplete-fido-mode-map ;; (kbd "DEL") #'b/icomplete-fido-backward-updir)) -;; (with-eval-after-load 'subr -;; (keyboard-translate ?\( ?\[) -;; (keyboard-translate ?\) ?\]) -;; (keyboard-translate ?\[ ?\() -;; (keyboard-translate ?\] ?\)) - -;; ;; (keyboard-translate ?\( ?\() -;; ;; (keyboard-translate ?\) ?\)) -;; ;; (keyboard-translate ?\[ ?\[) -;; ;; (keyboard-translate ?\] ?\]) -;; ) +;; subr +;; (keyboard-translate ?\( ?\[) +;; (keyboard-translate ?\) ?\]) +;; (keyboard-translate ?\[ ?\() +;; (keyboard-translate ?\] ?\)) ;; minibuffer -(csetq read-file-name-completion-ignore-case t) +(setq read-file-name-completion-ignore-case t) ;; startup ;; don't need to see the startup echo area message (advice-add #'display-startup-echo-area-message :override #'ignore) -(csetq +(setq ;; i want *scratch* as my startup buffer initial-buffer-choice t ;; i don't need the default hint @@ -305,7 +279,7 @@ This sets each user option VAR's value to the corresponding VALUE. inhibit-startup-echo-area-message user-login-name) ;; files -(csetq +(setq ;; backups (C-h v make-backup-files RET) backup-by-copying t backup-directory-alist (list (cons "." (b/var "backup/"))) @@ -321,21 +295,22 @@ This sets each user option VAR's value to the corresponding VALUE. ;; novice ;; disable disabled commands -(csetq disabled-command-function nil) +(setq disabled-command-function nil) ;; lazy-person-friendly yes/no prompts (defalias 'yes-or-no-p #'y-or-n-p) ;; autorevert: enable automatic reloading of changed buffers and files -(csetq auto-revert-verbose nil - global-auto-revert-non-file-buffers nil) +(setq + ;; auto-revert-verbose nil + global-auto-revert-non-file-buffers nil) (require 'autorevert) (global-auto-revert-mode 1) ;; time and battery in mode-line (run-with-idle-timer 0.1 nil #'require 'time) (with-eval-after-load 'time - (csetq + (setq display-time-default-load-average nil display-time-format " %a %b %-e %-l:%M%P" display-time-mail-icon '(image :type xpm @@ -351,7 +326,7 @@ This sets each user option VAR's value to the corresponding VALUE. (run-with-idle-timer 0.1 nil #'require 'battery) (with-eval-after-load 'battery - (csetq battery-mode-line-format " %p%% %t") + (setq battery-mode-line-format " %p%% %t") (display-battery-mode)) ;; (with-eval-after-load 'fringe @@ -364,7 +339,7 @@ This sets each user option VAR's value to the corresponding VALUE. (run-with-idle-timer 0.1 nil #'require 'windmove) (with-eval-after-load 'windmove - (csetq windmove-wrap-around t) + (setq windmove-wrap-around t) (global-set-key (kbd "M-H") #'windmove-left) (global-set-key (kbd "M-L") #'windmove-right) (global-set-key (kbd "M-K") #'windmove-up) @@ -393,7 +368,7 @@ This sets each user option VAR's value to the corresponding VALUE. (ad-activate 'compilation-start)) ;; isearch -(csetq +(setq ;; allow scrolling in Isearch isearch-allow-scroll t isearch-lazy-count t @@ -405,49 +380,49 @@ This sets each user option VAR's value to the corresponding VALUE. ;; replace ;; uncomment to extend the above behaviour to query-replace -;; (csetq replace-char-fold t) +;; (setq replace-char-fold t) ;; vc (global-set-key (kbd "C-x v C-=") #'vc-ediff) (with-eval-after-load 'vc-git - (csetq vc-git-print-log-follow t - vc-git-show-stash 0)) + (setq vc-git-print-log-follow t + vc-git-show-stash 0)) -(csetq ediff-window-setup-function 'ediff-setup-windows-plain - ediff-split-window-function 'split-window-horizontally) +(setq ediff-window-setup-function 'ediff-setup-windows-plain + ediff-split-window-function 'split-window-horizontally) (with-eval-after-load 'ediff (add-hook 'ediff-after-quit-hook-internal #'winner-undo)) ;; face-remap -(csetq +(setq ;; gentler font resizing text-scale-mode-step 1.05) (run-with-idle-timer 0.4 nil #'require 'mwheel) -(csetq mouse-wheel-scroll-amount '(1 ((shift) . 1)) ; one line at a time - mouse-wheel-progressive-speed nil ; don't accelerate scrolling - mouse-wheel-follow-mouse t) ; scroll window under mouse +(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)) ; one line at a time + mouse-wheel-progressive-speed nil ; don't accelerate scrolling + mouse-wheel-follow-mouse t) ; scroll window under mouse (run-with-idle-timer 0.4 nil #'require 'pixel-scroll) (with-eval-after-load 'pixel-scroll (pixel-scroll-mode 1)) ;; epg-config -(csetq +(setq epg-gpg-program (executable-find "gpg") ;; ask for GPG passphrase in minibuffer ;; this will fail if gpg>=2.1 is not available epg-pinentry-mode 'loopback) ;; auth-source -(csetq +(setq auth-sources '("~/.authinfo.gpg") authinfo-hidden (regexp-opt '("password" "client-secret" "token"))) ;; info (with-eval-after-load 'info - (csetq + (setq Info-directory-list `(,@Info-directory-list ,(expand-file-name @@ -612,8 +587,8 @@ Effectively a very simple light/dark theme toggle switch." ;; (require 'bandali-theme) ;; recently opened files -(csetq recentf-max-saved-items 2000 - recentf-save-file (b/var "recentf-save.el")) +(setq recentf-max-saved-items 2000 + recentf-save-file (b/var "recentf-save.el")) (run-with-idle-timer 0.2 nil #'require 'recentf) (with-eval-after-load 'recentf ;; (add-to-list 'recentf-keep #'file-remote-p) @@ -645,7 +620,7 @@ Effectively a very simple light/dark theme toggle switch." (with-eval-after-load 'help (temp-buffer-resize-mode) - (csetq help-window-select t)) + (setq help-window-select t)) (with-eval-after-load 'help-mode ;; local key bindings @@ -653,8 +628,8 @@ Effectively a very simple light/dark theme toggle switch." (define-key help-mode-map (kbd "n") #'forward-button)) (with-eval-after-load 'tramp - (csetq tramp-auto-save-directory (b/var "tramp/auto-save/") - tramp-persistency-file-name (b/var "tramp/persistency.el")) + (setq tramp-auto-save-directory (b/var "tramp/auto-save/") + tramp-persistency-file-name (b/var "tramp/persistency.el")) (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:")) (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil)) (add-to-list 'tramp-default-proxies-alist @@ -663,13 +638,13 @@ Effectively a very simple light/dark theme toggle switch." (with-eval-after-load 'doc-view (define-key doc-view-mode-map (kbd "M-RET") #'image-previous-line)) -(csetq shr-max-width 80) +(setq shr-max-width 80) ;; Email (with Gnus, message, and smtpmail) (require 'bandali-gnus) (require 'bandali-message) ;; (with-eval-after-load 'smtpmail -;; (csetq smtpmail-queue-mail t +;; (setq smtpmail-queue-mail t ;; smtpmail-queue-dir (concat b/maildir "queue/"))) ;; IRC (with ERC) @@ -678,8 +653,8 @@ Effectively a very simple light/dark theme toggle switch." ;; 'paste' service (aka scp + web server) (add-to-list 'load-path (b/lisp "scpaste")) (with-eval-after-load 'scpaste - (csetq scpaste-http-destination "https://p.bndl.org" - scpaste-scp-destination "p:~")) + (setq scpaste-http-destination "https://p.bndl.org" + scpaste-scp-destination "p:~")) (autoload 'scpaste "scpaste" nil t) (autoload 'scpaste-region "scpaste" nil t) (global-set-key (kbd "C-c a p p") #'scpaste) @@ -691,7 +666,7 @@ Effectively a very simple light/dark theme toggle switch." ;; display Lisp objects at point in the echo area (when (version< "25" emacs-version) (with-eval-after-load 'eldoc - (csetq eldoc-minor-mode-string " eldoc") + (setq eldoc-minor-mode-string " eldoc") (global-eldoc-mode))) ;; highlight matching parens @@ -701,7 +676,7 @@ Effectively a very simple light/dark theme toggle switch." ;; (require 'elec-pair) ;; (electric-pair-mode) -(csetq +(setq ;; Save what I copy into clipboard from other applications into Emacs' ;; kill-ring, which would allow me to still be able to easily access ;; it in case I kill (cut or copy) something else inside Emacs before @@ -713,17 +688,17 @@ Effectively a very simple light/dark theme toggle switch." ;; save minibuffer history (require 'savehist) -(csetq savehist-file (b/var "savehist.el")) +(setq savehist-file (b/var "savehist.el")) (savehist-mode) (add-to-list 'savehist-additional-variables 'kill-ring) ;; automatically save place in files (when (version< "25" emacs-version) - (csetq save-place-file (b/var "save-place.el")) + (setq save-place-file (b/var "save-place.el")) (save-place-mode)) (defun indicate-buffer-boundaries-left () - (csetq indicate-buffer-boundaries 'left)) + (setq indicate-buffer-boundaries 'left)) (with-eval-after-load 'prog-mode (global-prettify-symbols-mode)) (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left) @@ -737,17 +712,17 @@ Effectively a very simple light/dark theme toggle switch." (add-to-list 'auto-mode-alist '("\\.bashrc$" . sh-mode)) (with-eval-after-load 'flyspell - (csetq flyspell-mode-line-string " fly")) + (setq flyspell-mode-line-string " fly")) ;; ispell ;; http://endlessparentheses.com/ispell-and-apostrophes.html ;; (run-with-idle-timer 0.6 nil #'require 'ispell) ;; (with-eval-after-load 'ispell ;; ;; ’ can be part of a word -;; (csetq ispell-local-dictionary-alist -;; `((nil "[[:alpha:]]" "[^[:alpha:]]" -;; "['\x2019]" nil ("-B") nil utf-8)) -;; ispell-program-name (executable-find "hunspell")) +;; (setq ispell-local-dictionary-alist +;; `((nil "[[:alpha:]]" "[^[:alpha:]]" +;; "['\x2019]" nil ("-B") nil utf-8)) +;; ispell-program-name (executable-find "hunspell")) ;; ;; don't send ’ to the subprocess ;; (defun endless/replace-apostrophe (args) ;; (cons (replace-regexp-in-string @@ -766,7 +741,7 @@ Effectively a very simple light/dark theme toggle switch." ;; #'endless/replace-quote)) ;; abbrev -(csetq abbrev-file-name (b/etc "abbrev.el")) +(setq abbrev-file-name (b/etc "abbrev.el")) (add-hook 'text-mode-hook #'abbrev-mode) @@ -781,7 +756,7 @@ Effectively a very simple light/dark theme toggle switch." (add-to-list 'load-path (b/lisp "alloy-mode")) (autoload 'alloy-mode "alloy-mode" nil t) (with-eval-after-load 'alloy-mode - (csetq alloy-basic-offset 2) + (setq alloy-basic-offset 2) ;; (defun b/alloy-simple-indent (start end) ;; (interactive "r") ;; ;; (if (region-active-p) @@ -803,23 +778,23 @@ Effectively a very simple light/dark theme toggle switch." ;; (run-with-idle-timer 0.4 nil #'require 'lean-mode) ;; (with-eval-after-load 'lean-mode ;; (require 'lean-input) -;; (csetq default-input-method "Lean" -;; lean-input-tweak-all '(lean-input-compose -;; (lean-input-prepend "/") -;; (lean-input-nonempty)) -;; lean-input-user-translations '(("/" "/"))) +;; (setq default-input-method "Lean" +;; lean-input-tweak-all '(lean-input-compose +;; (lean-input-prepend "/") +;; (lean-input-nonempty)) +;; lean-input-user-translations '(("/" "/"))) ;; (lean-input-setup) ;; ;; local key bindings ;; (define-key lean-mode-map (kbd "S-SPC") #'company-complete)) (with-eval-after-load 'sgml-mode - (csetq sgml-basic-offset 0)) + (setq sgml-basic-offset 0)) (with-eval-after-load 'css-mode - (csetq css-indent-offset 2)) + (setq css-indent-offset 2)) ;; auctex -;; (csetq font-latex-fontify-sectioning 'color) +;; (setq font-latex-fontify-sectioning 'color) (with-eval-after-load 'tex-mode (cl-delete-if @@ -832,7 +807,7 @@ Effectively a very simple light/dark theme toggle switch." ;;; Emacs enhancements & auxiliary packages (with-eval-after-load 'man - (csetq Man-width 80)) + (setq Man-width 80)) (defun b/*scratch* () "Switch to `*scratch*' buffer, creating it if it does not exist." @@ -891,8 +866,8 @@ Effectively a very simple light/dark theme toggle switch." "yasnippet" (cmd)) (defconst yas-verbosity-cur yas-verbosity) - (setq yas-verbosity 2) - (csetq yas-snippet-dirs `(,(b/etc "yasnippet/snippets"))) + (setq yas-verbosity 2 + yas-snippet-dirs `(,(b/etc "yasnippet/snippets"))) ;; (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t) (yas-reload-all) (setq yas-verbosity yas-verbosity-cur) @@ -925,17 +900,17 @@ Effectively a very simple light/dark theme toggle switch." '("gnuzilla")))) ;; url and url-cache -(csetq +(setq url-configuration-directory (b/var "url/configuration/") url-cache-directory (b/var "url/cache/")) ;; eww -(csetq eww-download-directory (file-name-as-directory - (getenv "XDG_DOWNLOAD_DIR"))) +(setq eww-download-directory (file-name-as-directory + (getenv "XDG_DOWNLOAD_DIR"))) (global-set-key (kbd "C-c a e w") #'eww) ;; ;; org-ref -;; (csetq +;; (setq ;; reftex-default-bibliography '("~/usr/org/references.bib") ;; org-ref-default-bibliography '("~/usr/org/references.bib") ;; org-ref-bibliography-notes "~/usr/org/notes.org" @@ -944,7 +919,7 @@ Effectively a very simple light/dark theme toggle switch." ;; fill-column-indicator ? ;; window -(csetq split-width-threshold 150) +(setq split-width-threshold 150) (global-set-key (kbd "C-c w s l") (lambda () (interactive) @@ -977,8 +952,8 @@ Effectively a very simple light/dark theme toggle switch." ;; dmenu (add-to-list 'load-path (b/lisp "dmenu")) (with-eval-after-load 'dmenu - (csetq dmenu-prompt-string "run: " - dmenu-save-file (b/var "dmenu-items"))) + (setq dmenu-prompt-string "run: " + dmenu-save-file (b/var "dmenu-items"))) (autoload 'dmenu "dmenu" nil t) ;; eosd ? @@ -995,7 +970,7 @@ Effectively a very simple light/dark theme toggle switch." (require 'bandali-po) (with-eval-after-load 'emms - (csetq emms-directory (b/var "emms"))) + (setq emms-directory (b/var "emms"))) ;;; Post initialization diff --git a/.emacs.d/lisp/bandali-dired.el b/.emacs.d/lisp/bandali-dired.el index 9ed1030..c7ed77f 100644 --- a/.emacs.d/lisp/bandali-dired.el +++ b/.emacs.d/lisp/bandali-dired.el @@ -1,6 +1,6 @@ ;;; bandali-dired.el --- bandali's dired setup -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2020 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; Author: Amin Bandali ;; Keywords: files @@ -25,7 +25,7 @@ ;;; Code: (with-eval-after-load 'dired - (csetq + (setq dired-dwim-target t dired-listing-switches "-alh" dired-recent-directories-file (b/var "dired-recent-directories.el") @@ -77,15 +77,16 @@ (b/dired-start-process "zathura"))) (require 'dired-x) - (csetq dired-guess-shell-alist-user - '(("\\.pdf\\'" "evince" "zathura" "okular") - ("\\.doc\\'" "libreoffice") - ("\\.docx\\'" "libreoffice") - ("\\.ppt\\'" "libreoffice") - ("\\.pptx\\'" "libreoffice") - ("\\.xls\\'" "libreoffice") - ("\\.xlsx\\'" "libreoffice") - ("\\.flac\\'" "mpv")))) + (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) diff --git a/.emacs.d/lisp/bandali-erc.el b/.emacs.d/lisp/bandali-erc.el index 04d5fd3..1180e93 100644 --- a/.emacs.d/lisp/bandali-erc.el +++ b/.emacs.d/lisp/bandali-erc.el @@ -1,6 +1,6 @@ ;;; bandali-erc.el --- bandali's ERC setup -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2021 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; Author: Amin Bandali ;; Keywords: IRC, chat, client, Internet @@ -26,7 +26,7 @@ (with-eval-after-load 'erc (make-directory (b/var "erc/dcc") t) - (csetq + (setq erc-auto-query 'bury erc-autojoin-domain-only nil erc-dcc-get-default-directory (b/var "erc/dcc") @@ -84,7 +84,7 @@ ;; :foreground "steel blue") ;; erc-fill - ;; (csetq + ;; (setq ;; erc-fill-column 77 ;; erc-fill-function 'erc-fill-variable ;; erc-fill-static-center 18) @@ -106,7 +106,7 @@ directory)) (defun b/erc-log-file-name (&rest _) (concat (format-time-string "%Y-%m-%d") ".log")) - (csetq + (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 @@ -117,7 +117,7 @@ erc-save-queries-on-quit nil) ;; erc-match - (csetq + (setq erc-pal-highlight-type 'nick erc-pals '("bremner" "^gopar" "^iank" "quidam" "^rwp" "sudoman" @@ -132,12 +132,12 @@ :background "#ffffdf")) ;; erc-pcomplete - (csetq erc-pcomplete-nick-postfix ",") + (setq erc-pcomplete-nick-postfix ",") ;; erc-stamp - (csetq erc-timestamp-only-if-changed-flag nil - erc-timestamp-format "%T " - erc-insert-timestamp-function 'erc-insert-timestamp-left) + (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 @@ -146,7 +146,7 @@ :background 'unspecified)) ;; erc-track - (csetq + (setq erc-track-enable-keybindings nil erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT" "324" "329" "332" "333" "353" "477") diff --git a/.emacs.d/lisp/bandali-eshell.el b/.emacs.d/lisp/bandali-eshell.el index 574d8e1..e1326ef 100644 --- a/.emacs.d/lisp/bandali-eshell.el +++ b/.emacs.d/lisp/bandali-eshell.el @@ -1,6 +1,6 @@ ;;; bandali-eshell.el --- bandali's Eshell setup -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2020 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; Author: Amin Bandali ;; Keywords: processes @@ -26,7 +26,7 @@ (with-eval-after-load 'eshell (make-directory (b/etc "eshell/") t) - (csetq + (setq eshell-aliases-file (b/etc "eshell/aliases") eshell-directory-name (b/var "eshell/") eshell-hist-ignoredups t diff --git a/.emacs.d/lisp/bandali-exwm.el b/.emacs.d/lisp/bandali-exwm.el index ab9d34f..92f9b31 100644 --- a/.emacs.d/lisp/bandali-exwm.el +++ b/.emacs.d/lisp/bandali-exwm.el @@ -1,6 +1,6 @@ ;;; bandali-exwm.el --- bandali's EXWM configuration -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2021 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; Author: Amin Bandali ;; Keywords: tools @@ -27,8 +27,8 @@ (add-to-list 'load-path (b/lisp "xelb")) (add-to-list 'load-path (b/lisp "exwm")) (require 'exwm) -(csetq ;; exwm-replace t - exwm-workspace-show-all-buffers t) +(setq ;; exwm-replace t + exwm-workspace-show-all-buffers t) ;; make class name the buffer name, truncating beyond 60 characters (defun b/exwm-rename-buffer () (interactive) @@ -86,185 +86,187 @@ around if needed." 5 \% 6 \^ 7 \& 8 \* 9 \() "Mapping of shifted numbers on my keyboard.") -(csetq 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-\s] . (lambda () - ;; (interactive) - ;; (start-process-shell-command - ;; "rofi" nil "rofi -show run"))) - ([?\S-\s-\s] . (lambda (command) ; doesn't work in X windows - (interactive - (list (read-shell-command "➜ "))) - (start-process-shell-command - command nil command))) - ([s-return] . (lambda () - (interactive) - (start-process "" nil "urxvt"))) - ([S-s-return] . (lambda () - (interactive) - (start-process "" nil "urxvt" - "-name" "floating"))) - ([?\C-\s-\s] . counsel-linux-app) - ([?\M-\s-\s] . (lambda () - (interactive) - (start-process-shell-command - "rofi-pass" nil "rofi-pass"))) - ([?\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-F] . 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 () +(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-\s] . (lambda () + ;; (interactive) + ;; (start-process-shell-command + ;; "rofi" nil "rofi -show run"))) + ([?\S-\s-\s] . (lambda (command) ; doesn't work in X windows + (interactive + (list (read-shell-command "➜ "))) + (start-process-shell-command + command nil command))) + ([s-return] . (lambda () + (interactive) + (start-process "" nil "urxvt"))) + ([S-s-return] . (lambda () + (interactive) + (start-process "" nil "urxvt" + "-name" "floating"))) + ([?\C-\s-\s] . counsel-linux-app) + ([?\M-\s-\s] . (lambda () + (interactive) + (start-process-shell-command + "rofi-pass" nil "rofi-pass"))) + ([?\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-shell-command - "rofi-light" nil "rofi-light"))) - ([XF86AudioMute] . ; borken on my X200 :-( + (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) - (start-process "" nil "pamixer" "--toggle-mute"))) - ([XF86Launch1] . - (lambda () - (interactive) - (start-process "" nil "pamixer" "--toggle-mute"))) - ([\s-XF86Launch1] . ; toggle mic mute - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--default-source" "--toggle-mute"))) - ([XF86AudioLowerVolume] . - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--allow-boost" "--decrease" "5"))) - ([XF86AudioRaiseVolume] . - (lambda () - (interactive) - (start-process - "" nil "pamixer" "--allow-boost" "--increase" "5"))) - ([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))) + (exwm-workspace-move-window ,i)))) + (number-sequence 0 (1- exwm-workspace-number))) + ([?\s-F] . 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 + "rofi-light" nil "rofi-light"))) + ([XF86AudioMute] . ; borken on my X200 :-( + (lambda () + (interactive) + (start-process "" nil "pamixer" "--toggle-mute"))) + ([XF86Launch1] . + (lambda () + (interactive) + (start-process "" nil "pamixer" "--toggle-mute"))) + ([\s-XF86Launch1] . ; toggle mic mute + (lambda () + (interactive) + (start-process + "" nil "pamixer" "--default-source" "--toggle-mute"))) + ([XF86AudioLowerVolume] . + (lambda () + (interactive) + (start-process + "" nil "pamixer" "--allow-boost" "--decrease" "5"))) + ([XF86AudioRaiseVolume] . + (lambda () + (interactive) + (start-process + "" nil "pamixer" "--allow-boost" "--increase" "5"))) + ([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 -(csetq 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-s] . [?\C-s]) - ([?\C-g] . [escape]))) +(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-s] . [?\C-s]) + ([?\C-g] . [escape]))) (require 'exwm-manage) -(csetq +(setq exwm-manage-configurations '(((equal exwm-instance-name "floating") floating t @@ -287,7 +289,7 @@ around if needed." ([?\C-n] . [C-down])))))))) (require 'exwm-randr) -(csetq +(setq exwm-randr-workspace-monitor-plist '(0 "eDP-1" 1 "eDP-1" 2 "eDP-1" 3 "eDP-1" diff --git a/.emacs.d/lisp/bandali-gnus.el b/.emacs.d/lisp/bandali-gnus.el index a7fa68d..58fca3a 100644 --- a/.emacs.d/lisp/bandali-gnus.el +++ b/.emacs.d/lisp/bandali-gnus.el @@ -1,6 +1,6 @@ ;;; bandali-gnus.el --- bandali's Gnus setup -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2021 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; Author: Amin Bandali ;; Keywords: mail, news @@ -40,7 +40,7 @@ (declare-function article-make-date-line "gnus-art" (date type)) -(csetq +(setq mail-user-agent 'gnus-user-agent read-mail-command 'gnus @@ -201,7 +201,7 @@ (global-set-key (kbd "C-c M") #'gnus-unplugged) (with-eval-after-load 'gnus-art - (csetq + (setq gnus-buttonized-mime-types '("multipart/\\(signed\\|encrypted\\)") gnus-sorted-header-list '("^From:" "^X-RT-Originator" @@ -251,9 +251,9 @@ (define-key gnus-article-mode-map (kbd "M-L") #'org-store-link)) (with-eval-after-load 'gnus-sum - (csetq gnus-thread-sort-functions '(gnus-thread-sort-by-number - gnus-thread-sort-by-subject - gnus-thread-sort-by-date)) + (setq gnus-thread-sort-functions '(gnus-thread-sort-by-number + gnus-thread-sort-by-subject + gnus-thread-sort-by-date)) ;; local key bindings (define-key gnus-summary-mode-map (kbd "M-L") #'org-store-link) ;; (define-key gnus-summary-mode-map (kbd "r") @@ -286,7 +286,7 @@ Computer Science Club of the University of Waterloo") Free Software Consultant Savoir-faire Linux jami:bandali") - (csetq + (setq gnus-message-replysign t gnus-posting-styles '((".*" @@ -332,7 +332,7 @@ jami:bandali") ;; (mml-secure-message-sign))))) (with-eval-after-load 'gnus-topic - (csetq + (setq gnus-topic-line-format "%i[ %A: %(%{%n%}%) ]%v\n" gnus-topic-topology `(("Gnus" visible nil nil) @@ -348,33 +348,34 @@ jami:bandali") (("old-gnu" visible nil nil)))))))) (with-eval-after-load 'gnus-agent - (csetq gnus-agent-synchronize-flags 'ask)) + (setq gnus-agent-synchronize-flags 'ask)) (with-eval-after-load 'gnus-group - (csetq gnus-permanently-visible-groups "\\(:INBOX$\\|:gnu$\\)")) + (setq gnus-permanently-visible-groups "\\(:INBOX$\\|:gnu$\\)")) (with-eval-after-load 'gnus-win - (csetq gnus-use-full-window nil)) + (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-decode - (csetq ;; 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)) + (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)) (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") - (csetq mm-uu-diff-groups-regexp "."))) + (setq mm-uu-diff-groups-regexp "."))) (with-eval-after-load 'mml-sec - (csetq mml-secure-openpgp-encrypt-to-self t - mml-secure-openpgp-sign-with-sender t)) + (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 index 7cd4331..a706dc6 100644 --- a/.emacs.d/lisp/bandali-ibuffer.el +++ b/.emacs.d/lisp/bandali-ibuffer.el @@ -1,6 +1,6 @@ ;;; bandali-ibuffer.el --- bandali's Ibuffer setup -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2020 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; Author: Amin Bandali ;; Keywords: tools @@ -24,7 +24,7 @@ ;;; Code: -(csetq +(setq ibuffer-saved-filter-groups '(("default" ("dired" (mode . dired-mode)) diff --git a/.emacs.d/lisp/bandali-message.el b/.emacs.d/lisp/bandali-message.el index 9715d5b..384326f 100644 --- a/.emacs.d/lisp/bandali-message.el +++ b/.emacs.d/lisp/bandali-message.el @@ -1,6 +1,6 @@ ;;; bandali-message.el --- bandali's message.el setup -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2020 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; Author: Amin Bandali ;; Keywords: mail, news @@ -49,7 +49,7 @@ (concat "Hi %F,\n\n" b/message-cite-style-format) b/message-cite-style-format))) "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.") - (csetq + (setq message-elide-ellipsis "[...]\n" ;; message-cite-style 'message-cite-style-bandali message-citation-line-format "%N writes:\n" @@ -71,9 +71,9 @@ ;; footnote ;; (with-eval-after-load 'footnote - ;; (csetq footnote-start-tag "" - ;; footnote-end-tag "" - ;; footnote-style 'unicode)) + ;; (setq footnote-start-tag "" + ;; footnote-end-tag "" + ;; footnote-style 'unicode)) ;; custom newline & reformat function (defun b/message-newline-or-asterism (arg) diff --git a/.emacs.d/lisp/bandali-org.el b/.emacs.d/lisp/bandali-org.el index cd40b1e..940e556 100644 --- a/.emacs.d/lisp/bandali-org.el +++ b/.emacs.d/lisp/bandali-org.el @@ -1,6 +1,6 @@ ;;; bandali-org.el --- bandali's Org setup -*- lexical-binding: t; -*- -;; Copyright (C) 2018-2020 Amin Bandali +;; Copyright (C) 2018-2022 Amin Bandali ;; Author: Amin Bandali ;; Keywords: calendar, data, docs, hypermedia, outlines @@ -25,24 +25,25 @@ ;;; Code: (with-eval-after-load 'org - (csetq 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"))) + (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 @@ -95,9 +96,10 @@ (global-set-key (kbd "C-c a o a") #'org-agenda) (with-eval-after-load 'ox-latex - (csetq org-latex-listings 'listings - ;; org-latex-prefer-user-labels t - ) + (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}") -- 2.20.1