emacs.d/init.el

1912 lines
80 KiB
EmacsLisp
Raw Normal View History

(setq gc-cons-threshold 100000000)
(add-hook 'after-init-hook (lambda () (setq gc-cons-threshold 800000)))
2024-09-20 08:36:37 +02:00
;; (add-hook 'emacs-startup-hook
;; (lambda ()
;; (message "Emacs loaded in %s with %d garbage collections."
;; (format "%.2f seconds"
;; (float-time
;; (time-subtract after-init-time before-init-time)))
;; gcs-done)))
;; (setq gc-cons-threshold 100000000)
;; (add-hook 'after-init-hook (lambda () (setq gc-cons-threshold 800000)))
2023-12-27 14:08:58 +01:00
;; (require 'server)
;; (or (eq (server-running-p) t)
;; (server-start))
2023-12-27 14:05:11 +01:00
2024-08-25 09:42:16 +02:00
;; (load "bundle--general")
2024-11-03 12:34:34 +01:00
(setq default-frame-alist
2024-11-13 08:54:34 +01:00
`((font . "MonoLisa-12")
2024-11-03 12:34:34 +01:00
(width . 85)
(height . 50)
2024-11-06 20:04:53 +01:00
(vertical-scroll-bars . nil)
(fullscreen . maximized)
,(if (eq system-type 'gnu/linux) '(undecorated . t) '(undecorated . nil))))
2024-11-03 12:34:34 +01:00
2024-11-03 11:27:43 +01:00
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(eval-when-compile (require 'use-package))
(setq use-package-always-ensure t)
(use-package doom-themes
:init
(load-theme 'doom-one t)
:config
(setq doom-themes-enable-bold t
doom-themes-enable-italic t))
2024-09-20 08:36:37 +02:00
(tool-bar-mode -1)
(menu-bar-mode -1)
2024-08-25 09:42:16 +02:00
(global-hl-line-mode 1)
(display-time-mode 1)
(global-prettify-symbols-mode -1)
;; (setq display-time-format "W%V %a %d %b %Y %R %z")
2024-08-27 08:39:06 +02:00
(setq-default display-time-format "W%V %a %d %b %R")
(setq-default display-time-24hr-format t)
2024-08-25 09:42:16 +02:00
;; Cursor and mouse
(column-number-mode 1)
(mouse-wheel-mode 1)
(blink-cursor-mode -1)
2024-08-27 08:39:06 +02:00
(setq-default grep-command "grep -i -nH -e ")
2024-08-25 09:42:16 +02:00
(when (eq system-type 'gnu/linux)
2024-08-27 08:39:06 +02:00
(setq-default shell-file-name "/bin/bash")
(setq-default tex-shell-file-name "/bin/bash"))
2024-08-25 09:42:16 +02:00
;; Files and sessions
2024-08-27 08:39:06 +02:00
(setq-default auto-save-timeout 60)
2024-08-25 09:42:16 +02:00
;; Tabs, spaces, lines and parenthesis
(show-paren-mode 1)
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)
(setq-default line-spacing nil)
(setq-default make-backup-files nil)
(setq-default next-line-add-newlines t)
;; Miscellaneous
(require 'cl-lib)
2024-08-27 08:39:06 +02:00
(setq-default default-major-mode 'text-mode)
(setq-default inhibit-startup-buffer-menu t inhibit-startup-screen t)
2024-08-25 09:42:16 +02:00
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(defalias 'yes-or-no-p 'y-or-n-p)
(add-hook 'after-save-hook
'executable-make-buffer-file-executable-if-script-p)
(global-set-key (kbd "M-i") 'imenu)
(global-set-key (kbd "C-x C-b") 'ibuffer-list-buffers)
;;(global-set-key (kbd "M-[") 'tab-bar-history-back)
;;(global-set-key (kbd "M-]") 'tab-bar-history-forward)
(add-hook 'diary-display-hook 'fancy-diary-display)
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
(add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)
2024-08-27 08:39:06 +02:00
(setq-default compilation-ask-about-save nil)
2024-08-25 09:42:16 +02:00
2024-08-27 08:39:06 +02:00
(setq-default horizontal-scroll-bar nil)
(setq-default vertical-scroll-bar nil)
2024-10-22 09:05:29 +02:00
(scroll-bar-mode -1)
2024-08-25 09:42:16 +02:00
2024-08-27 08:39:06 +02:00
(setq-default mouse-wheel-scroll-amount '(1 ((shift) . 1) ((meta)) ((control) . text-scale)))
2024-08-25 09:42:16 +02:00
;; SIMPLE
2024-08-27 08:39:06 +02:00
(setq-default completion-auto-wrap t)
(setq-default completion-auto-select t)
2024-08-25 09:42:16 +02:00
;; MINIBUFFER
2024-10-26 14:39:49 +02:00
(setq completions-format 'one-column)
2024-08-25 09:42:16 +02:00
(setq completions-header-format nil)
(setq completions-max-height 20)
;; (require 'ido)
;; (setq ido-enable-flex-matching t)
;; (setq ido-everywhere t)
;; (setq ido-create-new-buffer 'always)
2024-10-26 14:39:49 +02:00
;; (setq ido-file-extensions-order '(".org" ".lisp" ".py" ".txt" ".el" ".epub"))
;; (ido-mode t)
(fido-mode 1) ; replace icomplete mode
2024-08-25 09:42:16 +02:00
;; (fido-vertical-mode 1)
;; UTF-8 FTW
2024-09-15 12:28:22 +02:00
;; Prefer UTF-8 encoding
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
2024-08-25 09:42:16 +02:00
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
2024-09-15 12:28:22 +02:00
;; Treat clipboard input as UTF-8 string first; compound text next, etc.
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
;; Set default file encoding to UTF-8
(setq-default buffer-file-coding-system 'utf-8)
;; Force UTF-8 for new files
(setq default-buffer-file-coding-system 'utf-8)
2024-08-25 09:42:16 +02:00
(setenv "PYTHONIOENCODING" "UTF-8")
(when (eq system-type 'gnu/linux)
2024-09-01 10:47:35 +02:00
(setq-default epg-pinentry-mode 'loopback)
2024-08-27 08:39:06 +02:00
(setq-default custom-file "~/.emacs.d/bundle/custom_gnu.el"
2024-08-25 09:42:16 +02:00
browse-url-secondary-browser-function 'browse-url-firefox)
(unless (file-directory-p "~/cl-sites/")
(async-shell-command "git clone git@git.sr.ht:~marcuskammer/cl-sites ~/cl-sites")))
(when (eq system-type 'windows-nt)
2024-08-27 08:39:06 +02:00
(setq-default explicit-shell-file-name
2024-08-25 09:42:16 +02:00
(seq-find 'file-executable-p
'("C:\\Program Files\\PowerShell\\7\\pwsh.exe"
"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe")))
2024-08-27 08:39:06 +02:00
(setq-default explicit-powershell.exe-args '("-NoProfile" "-InputFormat" "Text"))
(setq-default custom-file "~/.emacs.d/bundle/custom_win32.el")
2024-08-25 09:42:16 +02:00
(when (string= system-name "XPS-8930")
(cd "~/")
2024-08-27 08:39:06 +02:00
(setq-default custom-file "~/.emacs.d/bundle/custom_win32_XPS8930.el"))
2024-08-25 09:42:16 +02:00
(when (string= system-name "EVG03435NB")
(cd "~/OneDrive - Siemens AG/")
2024-08-27 08:39:06 +02:00
(setq-default custom-file "~/.emacs.d/bundle/custom_win32_EVG03435NB.el")))
2024-08-25 09:42:16 +02:00
(load custom-file :noerror)
2024-10-31 16:21:28 +01:00
(defun mk/exe-available-p (exe-name)
"Check if exe is available on the system."
(cond
;; Check for Windows
((eq system-type 'windows-nt)
(or (executable-find (format "%s.exe" exe-name))
(executable-find exe-name)))
;; Check for Linux and other Unix-like systems
((or (eq system-type 'gnu/linux)
(eq system-type 'darwin)
(eq system-type 'berkeley-unix))
(executable-find exe-name))
;; Return nil for unsupported systems
(t nil)))
2024-08-25 09:42:16 +02:00
;; (load "bundle--gui")
(setq-default mode-line-format
'("%e" mode-line-front-space "%Z" " " "%b %*%n %I %l:%c %p" (vc-mode vc-mode) " " mode-line-modes mode-line-misc-info mode-line-end-spaces))
2024-08-25 09:42:16 +02:00
(unless (memq 'hs-headline mode-line-format)
(setq mode-line-format
(append '(" " hs-headline) mode-line-format)))
(set-face-attribute 'mode-line nil
:slant 'italic
:weight 'bold
:background (face-attribute 'default :background)
:foreground
(cond ((member 'doom-one custom-enabled-themes) "#5B6268")
((member 'doom-nord custom-enabled-themes) "#9099AB")
(t (face-attribute 'mode-line-inactive :foreground)))
:box '(:line-width (1 . 8) :style flat-button))
(set-face-attribute 'mode-line-inactive nil
:inherit 'mode-line
:weight 'normal
:box '(:line-width (1 . 8) :style flat-button))
(use-package tab-bar
2024-10-26 14:40:31 +02:00
:bind (("C-M-[" . tab-bar-switch-to-prev-tab)
2024-10-30 09:20:51 +01:00
("C-M-]" . tab-bar-switch-to-next-tab)
("<f7>" . tab-bar-mode))
2024-08-25 09:42:16 +02:00
:custom
(tab-bar-auto-width nil)
(tab-bar-auto-width-max '(250 25))
(tab-bar-format '(tab-bar-format-history tab-bar-format-tabs-groups))
(tab-bar-tab-name-function 'tab-bar-tab-name-truncated)
(tab-bar-close-button-show nil)
(tab-bar-new-button-show nil)
:config
(set-face-attribute 'tab-bar nil
:inherit 'mode-line-inactive
:background (face-attribute 'mode-line-inactive :background))
(set-face-attribute 'tab-bar-tab nil
:inherit 'mode-line
:foreground (face-attribute 'mode-line :foreground)
:box '(:line-width 8 :style flat-button))
(set-face-attribute 'tab-bar-tab-inactive nil
:inherit 'mode-line-inactive
:box '(:line-width 8 :style flat-button)))
(setq frame-resize-pixelwise t)
(defun center-frame (&optional frame)
"Center FRAME on the screen."
(interactive)
(let ((frame (or frame (selected-frame))))
(let ((frame-width (frame-pixel-width frame))
(frame-height (frame-pixel-height frame))
(display-width (display-pixel-width))
(display-height (display-pixel-height)))
(set-frame-position frame
(/ (- display-width frame-width) 2)
(/ (- display-height frame-height) 2)))))
(add-hook 'after-make-frame-functions #'center-frame)
(use-package all-the-icons
:commands all-the-icons-install-fonts
:init
(when (display-graphic-p)
(unless (find-font (font-spec :name "all-the-icons"))
(all-the-icons-install-fonts t))))
2024-08-25 09:42:16 +02:00
(use-package all-the-icons-dired
:after all-the-icons
:hook (dired-mode . all-the-icons-dired-mode))
(use-package emojify
:hook (erc-mode . emojify-mode)
:commands emojify-mode
:config
(when (member "Segoe UI Emoji" (font-family-list))
2024-09-30 13:46:36 +02:00
(set-fontset-font
t 'symbol (font-spec :family "Segoe UI Emoji") nil 'prepend))
(setq emojify-display-style 'unicode)
(setq emojify-emoji-styles '(unicode))
(bind-key* (kbd "C-c .") #'emojify-insert-emoji))
2024-08-25 09:42:16 +02:00
;; (defun my-vc-info ()
;; (when vc-mode
;; (concat (substring vc-mode 5)
;; " ["
;; (substring (vc-working-revision (buffer-file-name)) 0 8)
;; "] ")))
;; (defun my-project-name ()
;; (let ((proj (project-current)))
;; (if proj (file-name-base (directory-file-name (project-root proj)))
;; "NoProject")))
;; (setq-default header-line-format
;; (list "-%M"
;; '(:eval (my-project-name)) " "
;; system-name " " user-login-name " "
;; "-%-"))
;; (setq-default mode-line-format
;; (list "-%b %*%n %I %l:%c %p "
;; '(:eval mode-name) " "
;; '(:eval (my-vc-info))
;; '(:eval (if mode-line-process (concat ":" mode-line-process " ") ""))
;; 'default-directory
;; "-%-"))
;; (set-face-attribute 'mode-line nil :weight 'bold)
;; (set-face-attribute 'header-line nil :weight 'bold)
;; (use-package doom-modeline
;; :hook (after-init . doom-modeline-mode)
;; :custom
;; (doom-modeline-height 30)
;; (doom-modeline-bar-width 4)
;; (doom-modeline-icon nil)
;; (doom-modeline-major-mode-icon nil)
;; (doom-modeline-unicode-fallback nil)
;; (doom-modeline-minor-modes nil)
;; (doom-modeline-buffer-encoding nil)
;; (doom-modeline-battery nil))
(use-package helpful
:commands (helpful-callable helpful-variable helpful-command helpful-key)
:bind ([remap describe-command] . helpful-command) ([remap describe-key] . helpful-key))
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package olivetti
:custom (olivetti-body-width 83)
:bind ("<f6>" . olivetti-mode))
(add-hook 'Info-mode-hook
(lambda ()
(make-local-variable 'olivetti-body-width)
(setq olivetti-body-width 75)
(olivetti-mode)))
(use-package ace-window :init (global-set-key (kbd "M-o") 'ace-window))
;; (use-package vertico :init (vertico-mode))
(use-package webjump
:bind ("C-c j" . webjump)
:custom
(webjump-sites
(append '(("Wikipedia_de" . [simple-query "de.wikipedia.org" "https://de.wikipedia.org/wiki/" ""])
("leo.org" . [simple-query "dict.leo.org" "https://dict.leo.org/german-english/" ""]))
webjump-sample-sites)))
(use-package doc-view
:ensure nil
2024-10-31 16:21:28 +01:00
:init (mk/exe-available-p "mutool")
2024-08-25 09:42:16 +02:00
:custom
2024-09-17 20:45:36 +02:00
(doc-view-continuous nil)
(doc-view-scale-internally nil)
(doc-view-cache-size 32)
(doc-view-prefetch-pages t)
2024-08-25 09:42:16 +02:00
(doc-view-dvipdfm-program "mutool")
(doc-view-odf->odf-converter-program "soffice")
(dov-view-odf->pdf-converter-function 'doc-view-odf->pdf-converter-soffice)
(doc-view-pdf->png-converter-function 'doc-view-pdf->png-converter-mupdf)
2024-09-17 20:45:36 +02:00
(doc-view-resolution 200))
2024-08-25 09:42:16 +02:00
(use-package hideshow
:hook ((prog-mode . (lambda () (hs-minor-mode 1))))
:bind (:map prog-mode-map
("M-<return>" . hs-toggle-hiding))
:custom
(hs-allow-nesting t))
(add-hook 'prog-mode-hook (lambda () (setq line-spacing 4)))
2024-10-26 13:44:46 +02:00
(use-package vc
:ensure nil
:custom
(vc-handled-backends '(Git Hg)))
2024-08-25 09:42:16 +02:00
;; (load "bundle--package")
(require 'package)
(defun get-auth-key (host)
"Retrieve the Anthropics API key using 'auth-source'."
(require 'auth-source)
(let* ((auth-source-creation-prompts
'((secret . "API key for %u@%h: ")))
(found (nth 0 (auth-source-search
:max 1
:host host
:user "apikey"
:require '(:secret)
:create t)))
(secret (plist-get found :secret)))
(if (functionp secret)
(funcall secret)
secret)))
(use-package htmlize)
(use-package time
:ensure nil
:config
(setq world-clock-time-format "%a %d %b %R %Z")
(setq world-clock-list
'(("America/Los_Angeles" "Seattle")
("America/New_York" "New York")
("Europe/London" "London")
("Europe/Paris" "Paris")
("Europe/Sofia" "Sofia")
("Asia/Calcutta" "Bangalore")
("Asia/Tokyo" "Tokyo"))))
(use-package autoinsert
:ensure nil
:init (auto-insert-mode 1)
:config
(setq auto-insert-query nil)
(let ((new-templates
'((("\\.sh\\'" . "Shell script header") nil "#!/bin/bash\n# -*- mode: shell-script; coding: utf-8; -*-\n")
(("\\.js\\'" . "JavaScript header") nil "#!/usr/bin/env node\n// -*- mode: js; coding: utf-8; -*-\n")
(("\\.css\\'" . "CSS header") nil "/* -*- mode: css; coding: utf-8; -*-\n * Dependencies: none\n */\n")
(("\\.html\\'" . "HTML header") nil "<!-- -*- mode: web; coding: utf-8; -*- -->\n")
(("\\.lisp\\'" . "Lisp header") nil ";;;; -*- mode: common-lisp; coding: utf-8; -*-\n"))))
(setq auto-insert-alist (nconc new-templates auto-insert-alist))))
(use-package tramp
:ensure nil
:config
(when (eq system-type 'windows-nt)
(setq tramp-default-method "sshx")))
(use-package shr
:custom
(shr-use-colors nil)
(shr-use-fonts nil)
(shr-inhibit-images t)
(shr-cookie-policy nil)
(shr-width nil))
(use-package shrface
:hook ((eww-after-render . shrface-mode)
(nov-mode . shrface-mode))
:custom
(shrface-href-versatile t)
(shrface-toggle-bullets t)
:config
(shrface-basic)
(shrface-trial)
(shrface-default-keybindings))
2024-10-31 16:21:28 +01:00
(when (mk/exe-available-p "hunspell")
2024-08-25 09:42:16 +02:00
(progn
(use-package flyspell
:hook ((LaTeX-mode . flyspell-mode)
(org-mode . flyspell-mode)
2024-10-26 14:40:44 +02:00
(text-mode . flyspell-mode)))
2024-08-25 09:42:16 +02:00
(use-package ispell
:ensure nil
:config
2024-10-31 16:21:28 +01:00
;; On windows: Copy *.aff and *.dic files to C:\msys64\ucrt64\share\hunspell or C:\cygwin64\usr\share\myspell
2024-08-25 09:42:16 +02:00
;; `hunspell -D`, the program will display the dictionaries and affix files it
;; finds and loads.
;; (when (eq system-type 'windows-nt)
;; (setq ispell-program-name "c:/msys64/ucrt64/bin/hunspell.exe"))
(setq ispell-program-name "hunspell")
(setq ispell-dictionary "german,english")
(setq ispell-local-dictionary-alist
'(("german" "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-d" "de_DE_frami,de_AT_frami,de_CH_frami") nil utf-8)
("english" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US,en_GB") nil utf-8)
("german,english" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "de_DE_frami,en_US") nil utf-8)))
(setq ispell-hunspell-dictionary-alist ispell-local-dictionary-alist))))
(defun mk/nov-font-settings ()
(setq-local line-spacing 2))
(use-package browse-url
:custom
(browse-url-browser-function 'eww-browse-url))
(use-package eww
:config
(require 'shrface))
(use-package nov
:defer t
2024-08-25 09:42:16 +02:00
:hook ((nov-mode . visual-line-mode)
(nov-mode . mk/nov-font-settings))
:mode ("\\.epub\\'" . nov-mode)
:custom
(nov-header-line-format nil)
(nov-text-width 82)
(nov-variable-pitch nil)
:config
(require 'shrface)
(setq nov-shr-rendering-functions '((img . nov-render-img) (title . nov-render-title)))
(setq nov-shr-rendering-functions (append nov-shr-rendering-functions shr-external-rendering-functions)))
;; (when (eq system-type 'windows-nt)
;; (setq nov-unzip-program "c:/msys64/usr/bin/unzip.exe")))
(use-package eglot
:hook ((typescript-mode . eglot-ensure)
(js2-mode . eglot-ensure))
:config
(if (eq system-name 'windows-nt)
;; %USERPROFILE%\AppData\Local\Programs\clangd-windows-17.0.3\clangd_17.0.3\bin
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd"))
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "ccls"))))
(use-package sql
:defer t
2024-11-27 12:13:19 +01:00
:mode (("\\.sql\\'" . sql-mode)
("\\.sqlite\\'" . sql-mode))
2024-08-25 09:42:16 +02:00
:config
(setq sql-connection-alist
'((finance-db
(sql-product 'sqlite)
(sql-database "~/Documents/org/data/FINANCE.db"))))
(when (eq system-type 'windows-nt)
(setq sql-postgres-program "C:/Program Files/PostgreSQL/16/bin/psql.exe")
2024-11-27 12:13:39 +01:00
(let ((path "C:/cygwin64/bin/sqlite3.exe"))
(when (file-exists-p path)
(setq sql-sqlite-program path)))
(setq sql-sqlite-options '("-interactive" "-column" "-header"))
2024-08-25 09:42:16 +02:00
(setq sql-mariadb-options '("-C" "-t" "-f" "-n"))
(setq sql-mysql-options '("-C" "-t" "-f" "-n"))))
;; (defun me/c-mode-style-hook ()
;; ;; https://www.gnu.org/prep/standards/html_node/Writing-C.html
;; ;; if linux kernel source use linux style, else use gnu style
;; (c-set-style
;; (if (and (buffer-file-name)
;; (string-match "/usr/src/linux" (buffer-file-name)))
;; "linux"
;; "gnu")))
;; (use-package cc-mode
;; :defer t
;; :ensure nil
;; :hook ((c-mode-common . c-toggle-auto-newline)
;; (c-mode-common . me/c-mode-style-hook))
;; :custom
;; (fill-column 79)
;; (c-basic-offset 2)
;; (indent-tabs-mode nil)
;; :config
;; (define-key c-mode-base-map (kbd "RET") 'newline-and-indent))
;; (defun me/c-mode-compile-command-hook ()
;; ;; if no makefile use gcc for compile command
;; (unless (or (file-exists-p "makefile")
;; (file-exists-p "Makefile"))
;; (set (make-local-variable 'compile-command)
;; (concat "gcc " "-Wall " "-g " buffer-file-name " -o "
;; (file-name-sans-extension buffer-file-name)))))
;; (add-hook 'c-mode-common-hook 'me/c-mode-compile-command-hook)
;; (defun me/c-mode-compile-on-save ()
;; ;; compile on save hook
;; (make-local-variable 'after-save-hook)
;; (add-hook 'after-save-hook (lambda () (compile compile-command))))
;; (add-hook 'c-mode-common-hook 'me/c-mode-compile-on-save)
;; (use-package js-mode
;; :ensure nil
;; :hook (js-mode . eglot-ensure)
;; :mode (("\\.webmanifest\\'" . js-mode)
;; ("\\.js\\'" . js-mode)
;; ("\\.mjs\\'" . js-mode)
;; ("\\.cjs\\'" . js-mode)))
(use-package js2-mode
:mode
(("\\.webmanifest\\'" . js2-mode)
("\\.js\\'" . js2-mode)
("\\.mjs\\'" . js2-mode)
("\\.cjs\\'" . js2-mode))
:config
(add-to-list 'interpreter-mode-alist '("node" . js2-mode)))
;; (use-package go-mode
;; :defer t
;; :mode ("\\.go\\'" . go-mode)
;; :hook ((before-save . gofmt-before-save)
;; (go-mode . eglot-ensure))
;; :config
;; (defun me/go-mode-compile-command-hook ()
;; ;; if no makefile use go vet for compile command
;; (unless (or (file-exists-p "makefile")
;; (file-exists-p "Makefile"))
;; (set (make-local-variable 'compile-command)
;; (concat "go " "vet " buffer-file-name))))
;; (add-hook 'go-mode-hook 'me/go-mode-compile-command-hook)
;; (defun me/go-mode-compile-on-save ()
;; ;; compile on save hook
;; (make-local-variable 'after-save-hook)
;; (add-hook 'after-save-hook (lambda () (compile compile-command)))))
;; ;; (add-hook 'go-mode-hook 'me/go-mode-compile-on-save)))
(use-package web-mode
;; :hook html-mode
:mode (("\\.html?\\'" . web-mode)
("\\.xhtml?\\'" . web-mode)
("\\.tmpl\\'" . web-mode)
("\\.hbs\\'" . web-mode)
("\\.handlebars\\'" . web-mode))
:custom
(web-mode-markup-indent-offset 2)
(web-mode-css-indent-offset 2)
(web-mode-code-indent-offset 2)
(web-mode-enable-auto-pairing nil)
(web-mode-enable-auto-closing t)
(web-mode-enable-current-element-highlight t)
(web-mode-enable-current-column-highlight t))
(use-package python
:mode (("\\.py\\'" . python-mode)
("\\.wsgi$" . python-mode)
("\\.j2" . python-mode))
:hook (python-mode . abbrev-mode)
:init
2024-09-27 21:03:47 +02:00
(setq python-interpreter
(cond ((executable-find "python3") "python3")
((executable-find "python") "python")
(t "python3")))
2024-08-25 09:42:16 +02:00
(setq python-indent-guess-indent-offset nil)
(setq python-indent-offset 4)
(setq python-shell-interpreter "ipython")
(setq python-shell-interpreter-args "-i --simple-prompt --InteractiveShell.display_page=True")
:custom
(fill-column 79))
;; (use-package simple-httpd
;; :defer t)
(use-package go-translate
:bind (("C-c t" . gt-do-translate))
:config
2024-09-07 10:25:19 +02:00
(setq gt-polyglot-p t)
(setq gt-langs '(en de fr it es))
(setq gt-default-translator
(gt-translator
:taker (gt-taker :langs '(en fr de it es) :text 'paragaph :pick nil)
:engines (list (gt-bing-engine) (gt-google-engine))
:render (gt-buffer-render))))
2024-08-25 09:42:16 +02:00
(use-package magit
:defer t
2024-08-25 09:42:16 +02:00
:bind ("C-x g" . magit-status)
:init
(when (eq system-type 'windows-nt)
(setq magit-git-executable "C:/Program Files/Git/mingw64/libexec/git-core/git.exe"))
:custom
(magit-diff-refine-hunk 'all)
(magit-display-buffer-function 'magit-display-buffer-fullcolumn-most-v1)
(magit-ediff-dwim-show-on-hunks t)
(magit-log-arguments '("--graph" "--color" "--decorate" "--show-signature" "--follow" "-n256"))
(magit-log-margin-show-committer-date t)
(magit-log-remove-graph-args '("--follow" "--grep" "-G" "-S" "-L"))
(magit-todos-insert-after '(bottom))
:config
(global-set-key (kbd "C-x M-g") 'magit-dispatch))
(use-package yaml-mode
:mode "\\.yml\\'"
:hook
(yaml-mode . (lambda () (auto-fill-mode -1))))
(use-package csv-mode
:mode "\\.csv\\'")
(use-package markdown-mode
:mode "\\.md\\'")
;; (use-package typescript-mode
;; :defer t
;; :mode "\\.ts\\'"
;; :hook (typescript-mode . eglot-ensure)
;; :config (setq typescript-indent-level 2))
(when (eq system-type 'gnu/linux)
(use-package spotify
:bind ("S-<pause>" . spotify-playpause)))
(use-package mastodon
:defer t
:custom
(mastodon-instance-url "https://emacs.ch")
(mastodon-active-user "qhBidG3d"))
(use-package jabber
:defer t
2024-09-15 16:38:58 +02:00
:bind (("C-x j c" . jabber-connect)
("C-x j d" . jabber-disconnect))
:init
(setq jabber-activity-mode nil)
(setq jabber-account-list '(("marcus.kammer@mailbox.org")))
2024-08-25 09:42:16 +02:00
:custom
(jabber-muc-decorate-presence-patterns
'(("enters the room" . nil)
("has entered the room" . nil)
("joined the room" . nil)
("has left the chatroom" . nil)))
(jabber-muc-autojoin
'("lisp@conference.a3.pm"
"emacs@conference.conversations.im"
2024-10-07 10:32:27 +02:00
"userexperience@conference.mailbox.org"
"metalisp@conference.mailbox.org"))
2024-08-25 09:42:16 +02:00
(jabber-muc-default-nicknames
'(("lisp@conference.a3.pm" . "marcus")
("emacs@conference.conversations.im" . "marcus")
2024-10-07 10:32:27 +02:00
("userexperience@conference.mailbox.org" . "marcus")
("metalisp@conference.mailbox.org" . "marcus"))))
2024-08-25 09:42:16 +02:00
;; (use-package hyperbole
;; :config
;; (setq hyrolo-date-format "%Y-%m-%d %H:%M:%S")
;; (add-hook 'hyperbole-init-hook
;; (lambda ()
;; (setq hyrolo-file-list
;; (append (hyrolo-initialize-file-list)
;; (cons "~/.rolo.otl"
;; (directory-files-recursively org-directory (rx "." (or "org" "otl") eos))))))))
(use-package plantuml-mode
:mode ("\\.puml\\'" "\\.plantuml\\'")
:custom
(plantuml-default-exec-mode 'jar)
(plantuml-jar-path "~/plantuml.jar")
(org-plantuml-jar-path "~/plantuml.jar")
(plantuml-java-args '("-DPLANTUML_DPI=300" "-Djava.awt.headless=true" "-jar" "--illegal-access=deny")))
(use-package tex-mode
:defer t
:config
;; TeX mode settings for editing .tex files
(setq TeX-auto-save t) ; Enable auto-save
(setq TeX-electric-math (cons "$" "$")) ; Shortcut for math mode
(if (eq system-type 'windows-nt)
(progn
(setq TeX-view-program-list '(("SumatraPDF" "~/AppData/Local/SumatraPDF/SumatraPDF.exe %o")))
(setq TeX-view-program-selection '((output-pdf "SumatraPDF"))))
(setq TeX-view-program-selection '((output-pdf "Evince"))))
(setq TeX-source-correlate-start-server t) ; Enable source-correlate
(setq TeX-master nil) ; Default master file
(setq TeX-engine 'luatex) ; Set engine to XeTeX
(setq TeX-command-extra-options "-shell-escape")) ; Allow shell escape
2024-11-11 07:36:59 +01:00
;; (use-package auctex
;; :hook ((LaTeX-mode . turn-on-reftex)
;; (LaTeX-mode . LaTeX-math-mode))
;; :custom
;; (LaTeX-indent-level 4)
;; (LaTeX-item-indent 0))
2024-08-25 09:42:16 +02:00
(use-package epg
:ensure nil
:config
(when (eq system-type 'windows-nt)
(setq epg-gpg-home-directory "~/AppData/Roaming/gnupg"
epg-gpg-program "c:/Program Files (x86)/GnuPG/bin/gpg.exe"
epg-gpgconf-program "c:/Program Files (x86)/GnuPG/bin/gpgconf.exe")))
(use-package which-key
:init (which-key-mode))
(use-package ssh-config-mode
:mode ("/sshd_config\\'" . ssh-config-mode)
:config
(add-hook 'ssh-config-mode-hook 'turn-on-font-lock))
(use-package nginx-mode
:mode ("/nginx/.*\\'" . nginx-mode))
(use-package dashboard
:config
(dashboard-setup-startup-hook))
;; (use-package flymake-json)
;; (use-package json-mode
;; :ensure nil
;; :mode "\\.json\\'"
;; :hook (json-mode . flymake-json-load))
;; (use-package json-navigator
;; :defer t
;; :after json-mode)
;; (use-package jq-format
;; :defer t
;; :after json-mode)
(use-package gptel
:bind (("C-c g" . gptel-menu)
("C-c G" . gptel)
("C-c M-g" . gptel-send)
:map gptel-mode-map
("C-c C-c" . gptel-send)
("C-c C-k" . gptel-abort))
:config
(when (eq system-type 'windows-nt)
2024-11-12 16:21:35 +01:00
(setq gptel-use-curl t))
2024-08-25 09:42:16 +02:00
(setq gptel-prompt-prefix-alist
'((markdown-mode . "# ")
(org-mode . "* ")
(text-mode . "# ")))
(setq gptel-default-mode 'org-mode)
2024-11-17 10:50:05 +01:00
(setq gptel-model 'claude-3-5-sonnet-20240620)
2024-08-25 09:42:16 +02:00
(setq gptel-backend (gptel-make-anthropic "Claude" :stream t :key gptel-api-key))
(setq gptel-directives
2024-10-07 10:32:41 +02:00
(append gptel-directives
2024-11-17 10:50:05 +01:00
'((lisp-dev . "You are an experienced Common Lisp developer with deep expertise in both functional programming principles and CLOS (Common Lisp Object System). You specialize in writing elegant, maintainable code that leverages Common Lisp's strengths in both paradigms. When explaining concepts, you provide practical code examples that demonstrate idiomatic Common Lisp usage. You emphasize functional programming techniques like pure functions, immutability, and higher-order functions while acknowledging that CLOS and mutable state have their place in practical applications. You guide developers in understanding when to use functional approaches (especially for data transformation, algorithmic logic, and concurrent operations) versus when to employ object-oriented features (particularly for modeling complex domains, implementing polymorphic behavior, and managing stateful resources). You always demonstrate proper use of the REPL-driven development style common in Lisp environments and explain how to leverage Emacs and SLIME/SLY for efficient development. Your code examples are concise but complete enough to be executable, and you follow Common Lisp naming conventions and best practices. You point out potential pitfalls and performance considerations when relevant. When discussing libraries or tools, you focus on established solutions in the Common Lisp ecosystem but remain pragmatic about integrating with other systems when necessary. You communicate in a clear, technically precise manner while remaining approachable and ready to clarify any concepts that may be unclear. Your response is always formatted as org-mode because I am talking with you within emacs.")
2024-10-07 10:32:41 +02:00
(bash . "You are an experienced Bash scripting teacher. I want to learn how to write Bash scripts. Please explain concepts clearly, provide examples, and guide me through writing scripts step-by-step. Let's start with the basics and gradually move to more advanced topics. If I have questions or need further clarification, help me understand the material thoroughly.")
(cs-teacher . "You are a virtual teaching assistant for a high school computer science course. The course focuses on functional programming, data structures, and algorithms using Common Lisp. Your goal is to provide clear, engaging, and educational explanations, examples, and exercises to help students grasp complex concepts. Your responses should be appropriate for high school students, keeping explanations simple yet thorough.")
(statistic-teacher . "You are a virtual teaching assistant for a high school statistic and math course. The course focuses on statistics. Your goal is to provide clear, engaging, and educational explanations, examples, and exercises to help students grasp complex concepts. Your responses should be appropriate for high school students, keeping explanations simple yet thorough. Apply the theoretical concepts you are explaining to the field of user experience and usability and provide short examples.")
(cl-stats . "You are a high school math teacher specializing in teaching statistics. Your students are new to the subject and are eager to learn through clear, step-by-step explanations. Use simple language and real-world examples to make complex statistical concepts understandable. Focus on breaking down key ideas like mean, median, mode, standard deviation, probability, and hypothesis testing. Additionally, when providing coding examples, use Common Lisp with an emphasis on functional programming techniques. Ensure that the code is well-commented and easy for beginners to follow. Introduce students to basic functional programming concepts such as higher-order functions, recursion, and immutability within the context of statistical problems. Make sure to: Start with basic concepts and gradually progress to more advanced topics. Include practical examples and exercises that students can try on their own. Encourage critical thinking and exploration by posing questions and challenges related to the statistical material. Use functional programming principles when writing Common Lisp code, explaining how these principles apply to the statistical problem at hand. Be patient, encouraging, and supportive, as you would be in a real classroom.")))))
2024-08-25 09:42:16 +02:00
(use-package gnuplot
:defer t)
(use-package docker)
(use-package dockerfile-mode
:mode ("\\.dockerfile\\'" . dockerfile-mode))
(use-package terraform-mode
:defer t
:custom
(terraform-format-on-save t))
;; (load "bundle--lisp")
(defvar mk/hyperspec-dir-locations
'("~/cl-sites/HyperSpec-7-0/HyperSpec/"
"~/HyperSpec-7-0/HyperSpec/")
"List of possible locations where the local HyperSpec could reside.")
(defun mk/hyperspec-dir ()
"Finds and returns the URI of the local HyperSpec directory.
Uses `mk/hyperspec-dir-locations' to find the directory."
(let ((dir (seq-find 'file-directory-p mk/hyperspec-dir-locations)))
(if dir
(concat "file://" (and (eq system-type 'windows-nt) "/") (expand-file-name dir))
nil)))
(setq common-lisp-hyperspec-root (mk/hyperspec-dir))
(use-package slime
:custom
(slime-autodoc-use-multiline-p 1)
:config
(define-key slime-mode-map (kbd "C-c C-q") 'slime-close-all-parens-in-sexp)
(slime-setup '(slime-autodoc
slime-tramp
slime-fancy
slime-asdf
slime-indentation
slime-editing-commands
slime-sbcl-exts))
;; To create a slime specific sbcl image:
;; shell$ sbcl
;; * (mapc 'require '(sb-bsd-sockets sb-posix sb-introspect sb-cltl2 asdf))
;; * (save-lisp-and-die "sbcl.core-for-slime")
;; Stop SLIME's REPL from grabbing DEL,
;; which is annoying when backspacing over a '('
;; (defun override-slime-repl-bindings-with-paredit ()
;; (define-key slime-repl-mode-map
;; (read-kbd-macro paredit-backward-delete-key) nil))
;; (add-hook 'slime-repl-mode-hook 'override-slime-repl-bindings-with-paredit)
(setq common-lisp-hyperspec-symbol-table
(concat common-lisp-hyperspec-root "Data/Map_Sym.txt"))
(setq common-lisp-hyperspec-issuex-table
(concat common-lisp-hyperspec-root "Data/Map_IssX.txt"))
(let ((image-path (expand-file-name "~/sbcl.core-for-slime")))
(if (file-exists-p image-path)
(setq slime-lisp-implementations
`((sbcl ("sbcl" "--noinform" "--core" ,image-path) :coding-system utf-8-unix)))
(setq slime-lisp-implementations
`((sbcl ("sbcl" "--noinform") :coding-system utf-8-unix)))))
(defvar mk/slime-remote-instances
'((:machine-instance "survey-metalisp"
:remote-host "survey.metalisp.dev"
:username "cl")
(:machine-instance "u1-marcsukammer"
:remote-host "u1.marcsukammer.dev"
:username "marcus")))
(mapc (lambda (instance)
(push (slime-create-filename-translator
:machine-instance (plist-get instance :machine-instance)
:remote-host (plist-get instance :remote-host)
:username (plist-get instance :username))
slime-filename-translations))
mk/slime-remote-instances)
;; syntax highlighting
(defvar slime-repl-font-lock-keywords lisp-font-lock-keywords-2)
(defun slime-repl-font-lock-setup ()
(setq font-lock-defaults
'(slime-repl-font-lock-keywords
;; From lisp-mode.el
nil nil (("+-*/.<>=!?$%_&~^:@" . "w")) nil
(font-lock-syntactic-face-function . lisp-font-lock-syntactic-face-function))))
(add-hook 'slime-repl-mode-hook 'slime-repl-font-lock-setup)
(defadvice slime-repl-insert-prompt (after font-lock-face activate)
(let ((inhibit-read-only t))
(add-text-properties
slime-repl-prompt-start-mark (point)
'(font-lock-face
slime-repl-prompt-face
rear-nonsticky
(slime-repl-prompt read-only font-lock-face intangible))))))
2024-10-26 14:40:16 +02:00
(use-package slime-company
:after (slime company)
:config (setq slime-company-completion 'fuzzy
slime-company-after-completion 'slime-company-just-one-space)
(add-to-list 'slime-contribs 'slime-company))
2024-08-25 09:42:16 +02:00
(use-package elisp-mode
:ensure nil
:hook ((emacs-lisp-mode . prettify-symbols-mode)
(emacs-lisp-mode . (lambda ()
(face-remap-add-relative 'font-lock-function-name-face nil :underline t)
(face-remap-add-relative 'font-lock-keyword-face nil :slant 'italic))))
:mode (("\\.el$" . emacs-lisp-mode))
:config
(setq-local lisp-indent-function 'lisp-indent-function)
(setq-local fill-column 84))
(use-package lisp-mode
:ensure nil
:hook ((lisp-mode . (lambda ()
(face-remap-add-relative 'font-lock-function-name-face nil :underline t)
(face-remap-add-relative 'font-lock-keyword-face nil :slant 'italic))))
:mode (("\\.lisp$" . lisp-mode)
("\\.lsp$" . lisp-mode)
2024-10-17 20:26:04 +02:00
("\\.cl$" . lisp-mode)
("\\.asd$" . lisp-mode))
2024-08-25 09:42:16 +02:00
:init
(setq inferior-lisp-program "sbcl --noinform")
:config
2024-10-17 20:26:04 +02:00
(setq-local comment-start ";; ")
(setq-local comment-start ";; ")
2024-08-25 09:42:16 +02:00
(setq-local lisp-indent-function 'common-lisp-indent-function)
(setq-local fill-column 84)
(defvar g-cl-function-names
'("*" "+" "-" "/" "/=" "1+" "1-" "<" "<=" "=" ">"
">=" "abort" "abs" "acons" "acos" "acosh" "add-method" "adjoin"
"adjust-array" "adjustable-array-p" "allocate-instance" "alpha-char-p"
"alphanumericp" "and" "append" "apply" "apropos" "apropos-list" "aref"
"arithmetic-error-operands" "arithmetic-error-operation" "array-dimension"
"array-dimensions" "array-displacement" "array-element-type"
"array-has-fill-pointer-p" "array-in-bounds-p" "array-rank"
"array-row-major-index" "array-total-size" "arrayp" "ash" "asin" "asinh"
"assert" "assoc" "assoc-if" "assoc-if-not" "atan" "atanh" "atom" "bit"
"bit-and" "bit-andc1" "bit-andc2" "bit-eqv" "bit-ior" "bit-nand" "bit-nor"
"bit-not" "bit-orc1" "bit-orc2" "bit-vector-p" "bit-xor" "block" "boole"
"both-case-p" "boundp" "break" "broadcast-stream-streams" "butlast" "byte"
"byte-position" "byte-size" "caaaar" "caaadr" "caaar" "caadar" "caaddr"
"caadr" "caar" "cadaar" "cadadr" "cadar" "caddar" "cadddr" "caddr" "cadr"
"call-method" "car" "case" "catch" "ccase" "cdaaar" "cdaadr" "cdaar"
"cdadar" "cdaddr" "cdadr" "cdar" "cddaar" "cddadr" "cddar" "cdddar" "cddddr"
"cdddr" "cddr" "cdr" "ceiling" "cell-error-name" "cerror" "change-class"
"char" "char-code" "char-downcase" "char-equal" "char-greaterp" "char-int"
"char-lessp" "char-name" "char-not-equal" "char-not-greaterp"
"char-not-lessp" "char-upcase" "char/=" "char<" "char<=" "char=" "char>"
"char>=" "character" "characterp" "check-type" "cis" "class-name" "class-of"
"clear-input" "clear-output" "close" "clrhash" "code-char" "coerce"
"compile" "compile-file" "compile-file-pathname" "compiled-function-p"
"compiler-macro-function" "complement" "complex" "complexp"
"compute-applicable-methods" "compute-restarts" "concatenate"
"concatenated-stream-streams" "cond" "conjugate" "cons" "consp" "constantly"
"constantp" "continue" "copy-alist" "copy-list" "copy-pprint-dispatch"
"copy-readtable" "copy-seq" "copy-structure" "copy-symbol" "copy-tree" "cos"
"cosh" "count" "count-if" "count-if-not" "ctypecase" "decf" "declaim"
"decode-float" "decode-universal-time" "defclass" "defconstant" "defgeneric"
"define-compiler-macro" "define-condition" "define-method-combination"
"define-modify-macro" "define-setf-expander" "define-symbol-macro"
"defmacro" "defmethod" "defpackage" "defparameter" "defsetf" "defstruct"
"deftype" "defun" "defvar" "delete" "delete-duplicates" "delete-file"
"delete-if" "delete-if-not" "delete-package" "denominator" "deposit-field"
"describe" "describe-object" "destructuring-bind" "digit-char"
"digit-char-p" "directory" "directory-namestring" "disassemble" "do" "do*"
"do-all-symbols" "do-external-symbols" "do-symbols" "documentation" "dolist"
"dotimes" "dpb" "dribble" "ecase" "echo-stream-input-stream"
"echo-stream-output-stream" "ed" "eighth" "elt" "encode-universal-time"
"endp" "enough-namestring" "ensure-directories-exist"
"ensure-generic-function" "eq" "eql" "equal" "equalp" "error" "etypecase"
"eval" "eval-when" "evenp" "every" "exp" "export" "expt" "fboundp"
"fceiling" "fdefinition" "ffloor" "fifth" "file-author"
"file-error-pathname" "file-length" "file-namestring" "file-position"
"file-string-length" "file-write-date" "fill" "fill-pointer" "find"
"find-all-symbols" "find-class" "find-if" "find-if-not" "find-method"
"find-package" "find-restart" "find-symbol" "finish-output" "first" "flet"
"float" "float-digits" "float-precision" "float-radix" "float-sign" "floatp"
"floor" "fmakunbound" "force-output" "format" "formatter" "fourth"
"fresh-line" "fround" "ftruncate" "funcall" "function" "function-keywords"
"function-lambda-expression" "functionp" "gcd" "gensym" "gentemp" "get"
"get-decoded-time" "get-dispatch-macro-character" "get-internal-real-time"
"get-internal-run-time" "get-macro-character" "get-output-stream-string"
"get-properties" "get-setf-expansion" "get-universal-time" "getf" "gethash"
"go" "graphic-char-p" "handler-bind" "handler-case" "hash-table-count"
"hash-table-p" "hash-table-rehash-size" "hash-table-rehash-threshold"
"hash-table-size" "hash-table-test" "host-namestring" "identity" "if"
"ignore-errors" "imagpart" "import" "in-package" "incf"
"initialize-instance" "input-stream-p" "inspect" "integer-decode-float"
"integer-length" "integerp" "interactive-stream-p" "intern" "intersection"
"invalid-method-error" "invoke-debugger" "invoke-restart"
"invoke-restart-interactively" "isqrt" "keywordp" "labels" "lambda" "last"
"lcm" "ldb" "ldb-test" "ldiff" "length" "let" "let*"
"lisp-implementation-type" "lisp-implementation-version" "list" "list*"
"list-all-packages" "list-length" "listen" "listp" "load"
"load-logical-pathname-translations" "load-time-value" "locally" "log"
"logand" "logandc1" "logandc2" "logbitp" "logcount" "logeqv"
"logical-pathname" "logical-pathname-translations" "logior" "lognand"
"lognor" "lognot" "logorc1" "logorc2" "logtest" "logxor" "long-site-name"
"loop" "loop-finish" "lower-case-p" "machine-instance" "machine-type"
"machine-version" "macro-function" "macroexpand" "macroexpand-1" "macrolet"
"make-array" "make-broadcast-stream" "make-concatenated-stream"
"make-condition" "make-dispatch-macro-character" "make-echo-stream"
"make-hash-table" "make-instance" "make-instances-obsolete" "make-list"
"make-load-form" "make-load-form-saving-slots" "make-package"
"make-pathname" "make-random-state" "make-sequence" "make-string"
"make-string-input-stream" "make-string-output-stream" "make-symbol"
"make-synonym-stream" "make-two-way-stream" "makunbound" "map" "map-into"
"mapc" "mapcan" "mapcar" "mapcon" "maphash" "mapl" "maplist" "mask-field"
"max" "member" "member-if" "member-if-not" "merge" "merge-pathnames"
"method-combination-error" "method-qualifiers" "min" "minusp" "mismatch"
"mod" "muffle-warning" "multiple-value-bind" "multiple-value-call"
"multiple-value-list" "multiple-value-prog1" "multiple-value-setq"
"name-char" "namestring" "nbutlast" "nconc" "nintersection" "ninth"
"no-applicable-method" "no-next-method" "not" "notany" "notevery" "nreconc"
"nreverse" "nset-difference" "nset-exclusive-or" "nstring-capitalize"
"nstring-downcase" "nstring-upcase" "nsublis" "nsubst" "nsubst-if"
"nsubst-if-not" "nsubstitute" "nsubstitute-if" "nsubstitute-if-not" "nth"
"nth-value" "nthcdr" "null" "numberp" "numerator" "nunion" "oddp" "open"
"open-stream-p" "or" "output-stream-p" "package-error-package"
"package-name" "package-nicknames" "package-shadowing-symbols"
"package-use-list" "package-used-by-list" "packagep" "pairlis"
"parse-integer" "parse-namestring" "pathname" "pathname-device"
"pathname-directory" "pathname-host" "pathname-match-p" "pathname-name"
"pathname-type" "pathname-version" "pathnamep" "peek-char" "phase" "plusp"
"pop" "position" "position-if" "position-if-not" "pprint" "pprint-dispatch"
"pprint-exit-if-list-exhausted" "pprint-fill" "pprint-indent"
"pprint-linear" "pprint-logical-block" "pprint-newline" "pprint-pop"
"pprint-tab" "pprint-tabular" "prin1" "prin1-to-string" "princ"
"princ-to-string" "print" "print-not-readable-object" "print-object"
"print-unreadable-object" "probe-file" "proclaim" "prog" "prog*" "prog1"
"prog2" "progn" "progv" "provide" "psetf" "psetq" "push" "pushnew" "quote"
"random" "random-state-p" "rassoc" "rassoc-if" "rassoc-if-not" "rational"
"rationalize" "rationalp" "read" "read-byte" "read-char" "read-char-no-hang"
"read-delimited-list" "read-from-string" "read-line"
"read-preserving-whitespace" "read-sequence" "readtable-case" "readtablep"
"realp" "realpart" "reduce" "reinitialize-instance" "rem" "remf" "remhash"
"remove" "remove-duplicates" "remove-if" "remove-if-not" "remove-method"
"remprop" "rename-file" "rename-package" "replace" "require" "rest"
"restart-bind" "restart-case" "restart-name" "return" "return-from"
"revappend" "reverse" "room" "rotatef" "round" "row-major-aref" "rplaca"
"rplacd" "sbit" "scale-float" "schar" "search" "second" "set"
"set-difference" "set-dispatch-macro-character" "set-exclusive-or"
"set-macro-character" "set-pprint-dispatch" "set-syntax-from-char" "setf"
"setq" "seventh" "shadow" "shadowing-import" "shared-initialize" "shiftf"
"short-site-name" "signal" "signum" "simple-bit-vector-p"
"simple-condition-format-arguments" "simple-condition-format-control"
"simple-string-p" "simple-vector-p" "sin" "sinh" "sixth" "sleep"
"slot-boundp" "slot-exists-p" "slot-makunbound" "slot-missing"
"slot-unbound" "slot-value" "software-type" "software-version" "some" "sort"
"special-operator-p" "sqrt" "stable-sort" "standard-char-p" "step"
"store-value" "stream-element-type" "stream-error-stream"
"stream-external-format" "streamp" "string" "string-capitalize"
"string-downcase" "string-equal" "string-greaterp" "string-left-trim"
"string-lessp" "string-not-equal" "string-not-greaterp" "string-not-lessp"
"string-right-trim" "string-trim" "string-upcase" "string/=" "string<"
"string<=" "string=" "string>" "string>=" "stringp" "sublis" "subseq"
"subsetp" "subst" "subst-if" "subst-if-not" "substitute" "substitute-if"
"substitute-if-not" "subtypep" "svref" "sxhash" "symbol-function"
"symbol-macrolet" "symbol-name" "symbol-package" "symbol-plist"
"symbol-value" "symbolp" "synonym-stream-symbol" "tagbody" "tailp" "tan"
"tanh" "tenth" "terpri" "the" "third" "throw" "time" "trace"
"translate-logical-pathname" "translate-pathname" "tree-equal" "truename"
"truncate" "two-way-stream-input-stream" "two-way-stream-output-stream"
"type-error-datum" "type-error-expected-type" "type-of" "typecase" "typep"
"unbound-slot-instance" "unexport" "unintern" "union" "unless" "unread-char"
"untrace" "unuse-package" "unwind-protect"
"update-instance-for-different-class" "update-instance-for-redefined-class"
"upgraded-array-element-type" "upgraded-complex-part-type" "upper-case-p"
"use-package" "use-value" "user-homedir-pathname" "values" "values-list"
"vector" "vector-pop" "vector-push" "vector-push-extend" "vectorp" "warn"
"when" "wild-pathname-p" "with-accessors" "with-compilation-unit"
"with-condition-restarts" "with-hash-table-iterator"
"with-input-from-string" "with-open-file" "with-open-stream"
"with-output-to-string" "with-package-iterator" "with-simple-restart"
"with-slots" "with-standard-io-syntax" "write" "write-byte" "write-char"
"write-line" "write-sequence" "write-string" "write-to-string" "y-or-n-p"
"yes-or-no-p" "zerop"))
(defvar g-cl-value-names
'("*" "**" "***" "*break-on-signals*"
"*compile-file-pathname*" "*compile-file-truename*" "*compile-print*"
"*compile-verbose*" "*debug-io*" "*debugger-hook*"
"*default-pathname-defaults*" "*error-output*" "*features*"
"*gensym-counter*" "*load-pathname*" "*load-print*" "*load-truename*"
"*load-verbose*" "*macroexpand-hook*" "*modules*" "*package*"
"*print-array*" "*print-base*" "*print-case*" "*print-circle*"
"*print-escape*" "*print-gensym*" "*print-length*" "*print-level*"
"*print-lines*" "*print-miser-width*" "*print-pprint-dispatch*"
"*print-pretty*" "*print-radix*" "*print-readably*" "*print-right-margin*"
"*query-io*" "*random-state*" "*read-base*" "*read-default-float-format*"
"*read-eval*" "*read-suppress*" "*readtable*" "*standard-input*"
"*standard-output*" "*terminal-io*" "*trace-output*" "+" "++" "+++" "-" "/"
"//" "///" "array-dimension-limit" "array-rank-limit"
"array-total-size-limit" "boole-1" "boole-2" "boole-and" "boole-andc1"
"boole-andc2" "boole-c1" "boole-c2" "boole-clr" "boole-eqv" "boole-ior"
"boole-nand" "boole-nor" "boole-orc1" "boole-orc2" "boole-set" "boole-xor"
"call-arguments-limit" "char-code-limit" "double-float-epsilon"
"double-float-negative-epsilon" "internal-time-units-per-second"
"lambda-list-keywords" "lambda-parameters-limit"
"least-negative-double-float" "least-negative-long-float"
"least-negative-normalized-double-float"
"least-negative-normalized-long-float"
"least-negative-normalized-short-float"
"least-negative-normalized-single-float" "least-negative-short-float"
"least-negative-single-float" "least-positive-double-float"
"least-positive-long-float" "least-positive-normalized-double-float"
"least-positive-normalized-long-float"
"least-positive-normalized-short-float"
"least-positive-normalized-single-float" "least-positive-short-float"
"least-positive-single-float" "long-float-epsilon"
"long-float-negative-epsilon" "most-negative-double-float"
"most-negative-fixnum" "most-negative-long-float"
"most-negative-short-float" "most-negative-single-float"
"most-positive-double-float" "most-positive-fixnum"
"most-positive-long-float" "most-positive-short-float"
"most-positive-single-float" "multiple-values-limit" "nil" "pi"
"short-float-epsilon" "short-float-negative-epsilon" "single-float-epsilon"
"single-float-negative-epsilon" "t"))
(defface g-cl-character-face
'((default :inherit font-lock-constant-face))
"The face used to highlight Common Lisp character literals.")
(defface g-cl-standard-function-face
'((default :inherit font-lock-keyword-face))
"The face used to highlight standard Common Lisp function symbols.")
(defface g-cl-standard-value-face
'((default :inherit font-lock-variable-name-face))
"The face used to highlight standard Common Lisp value symbols.")
(defvar g-cl-font-lock-keywords
(let* ((character-re (concat "#\\\\" lisp-mode-symbol-regexp "\\_>"))
(function-re (concat "(" (regexp-opt g-cl-function-names t) "\\_>"))
(value-re (regexp-opt g-cl-value-names 'symbols)))
`((,character-re . 'g-cl-character-face)
(,function-re
(1 'g-cl-standard-function-face))
(,value-re . 'g-cl-standard-value-face))))
(defvar g-cl-font-lock-defaults
'((g-cl-font-lock-keywords)
nil ; enable syntaxic highlighting
t ; case insensitive highlighting
nil ; use the lisp-mode syntax table
(font-lock-mark-block-function . mark-defun)
(font-lock-extra-managed-props help-echo)
(font-lock-syntactic-face-function
. lisp-font-lock-syntactic-face-function)))
2024-09-06 09:04:45 +02:00
2024-08-25 09:42:16 +02:00
(defun g-init-lisp-font-lock ()
(setq font-lock-defaults g-cl-font-lock-defaults))
(add-hook 'lisp-mode-hook 'g-init-lisp-font-lock))
(when (eq system-type 'gnu/linux)
2024-10-07 10:32:54 +02:00
(use-package cider
:defer t)
2024-08-25 09:42:16 +02:00
(use-package geiser
2024-10-11 10:09:42 +02:00
:defer t
2024-08-25 09:42:16 +02:00
:init
(setq geiser-repl-prompt-read-only t)
(setq geiser-repl-highlight-error-messages t)
2024-10-07 10:32:54 +02:00
(setq geiser-active-implementations '(chez guile))
2024-10-11 10:09:42 +02:00
(setq geiser-default-implementation 'guile)
2024-10-07 10:32:54 +02:00
:hook (scheme-mode . geiser-mode))
(use-package geiser-chez
:defer t
:after geiser)
(use-package geiser-guile
:defer t
:after geiser
:custom (geiser-guile-binary "guile")))
2024-08-25 09:42:16 +02:00
;; (use-package racket-mode
;; :mode "\\.rkt\\'")
;; (use-package geiser-racket
;; :defer t
;; :after geiser
;; :config
;; (when (eq system-type 'windows-nt)
;; (setq geiser-racket-binary "c:/Program Files/Racket/Racket.exe")))
;; (use-package ac-slime
;; :after (slime auto-complete)
;; :config
;; (add-hook 'slime-mode-hook 'set-up-slime-ac)
;; (add-hook 'slime-repl-mode-hook 'set-up-slime-ac))
(use-package paredit
:hook ((emacs-lisp-mode . paredit-mode)
(eval-expression-minibuffer-setup . paredit-mode)
(ielm-mode . paredit-mode)
(lisp-mode . paredit-mode)
(lisp-interaction-mode . paredit-mode)
(scheme-mode . paredit-mode))
:bind (:map paredit-mode-map
("M-s" . nil)
("C-M-s" . paredit-splice-sexp)))
;; (load "bundle--irc")
(defun mk/start-irc (nick)
(interactive "sTell me your nick please: ")
2024-10-22 16:41:17 +02:00
(let ((erc-sasl-mechanism 'external))
(erc-tls :server "irc.libera.chat"
:port 6697
:nick nick
:full-name "Jay Edgar Hoover"
:client-certificate "~/.irssi/cert/libera.pem")))
2024-08-25 09:42:16 +02:00
(use-package erc
:defer t
:custom
(erc-track-exclude '("#emacs"))
(erc-track-exclude-types '("JOIN" "NICK" "QUIT" "MODE" "AWAY"))
(erc-hide-list '("JOIN" "NICK" "QUIT" "MODE" "AWAY"))
(erc-track-exclude-server-buffer t)
(erc-fill-column 80)
(erc-fill-function 'erc-fill-static)
(erc-fill-static-center 20)
(erc-prompt-for-nickserv-password nil)
(erc-track-shorten-start 8)
(erc-auto-query 'bury)
(erc-network-hide-list '(("libera.chat" "JOIN" "PART" "QUIT")))
(erc-rename-buffers t)
(erc-interpret-mirc-color t)
(erc-kill-buffer-on-part t)
(erc-kill-queries-on-quit t)
(erc-kill-server-buffer-on-quit t)
(erc-modules
'(autojoin ; Set away status automatically
button ; Join channels automatically
completion ; Complete nicknames and commands (programmable)
fill ; Wrap long lines
irccontrols ; Highlight or remove IRC control characters
match ; Highlight pals, fools, and other keywords
menu ; Display a menu in ERC buffers
netsplit ; Detect netsplits
noncommands ; Dont display non-IRC commands after evaluation
readonly ; Make displayed lines read-only
ring ; Enable an input history
services ; Identify to Nickserv (IRC Services) automatically
smiley ; Convert smileys to pretty icons
stamp ; Add timestamps to messages
truncate ; Truncate buffers to a certain size
)))
(use-package erc-hl-nicks
:after erc
:config
(add-to-list 'erc-modules 'hl-nicks))
(use-package erc-image
:after erc
:config
(setq erc-image-inline-rescale 300)
(add-to-list 'erc-modules 'image))
;; (load "bundle--news")
(use-package elfeed
:init (setq elfeed-feeds
'(("https://netzpolitik.org/feed/" netz politik news)
("https://www.marcuskammer.dev/weblog/index.xml" personal)
("https://www.guyrutenberg.com/feed/" linux blog)
("https://blog.mozilla.org/en/feed/" browser web)
("https://blog.chromium.org/feeds/posts/default" browser web)
("https://hacks.mozilla.org/feed/" browser web)
("https://mailbox.org/share/feed-de-mailbox.xml" email mailbox web)
("https://feeds.feedburner.com/GoogleWebFonts" fonts blog google)
("https://twobithistory.org/feed.xml" history blog coding)
("https://blog.getbootstrap.com/feed.xml" web bootstrap blog)
("https://blog.mozilla.org/en/feed/" web firefox blog)
("https://fsfe.org/news/news.de.rss" fsfe news free-software)
("https://planet.lisp.org/rss20.xml" planet lisp)
("https://emacsconf.org/index.atom" emacs lisp conference)
("https://jameshunt.us/feeds/main" lisp blog)
("https://xenodium.com/rss.xml" emacs blog)
("https://stevelosh.com/rss.xml" lisp blog personal)
("https://planet.lisp.org/rss20.xml" lisp blogs)
("https://m-x-erlangen.gitlab.io/atom.xml" lisp meetup)
("https://takeonrules.com/index.atom" lisp emacs blog)
("https://emacsredux.com/atom.xml" emacs blog)
("https://planet.emacslife.com/atom.xml" emacs)
("https://yiming.dev/rss.xml" coding emacs lisp blog)
("https://endlessparentheses.com/atom.xml" emacs elisp blog)
("https://www.philnewton.net/blog/feed/" emacs blog)
("https://emacsredux.com/atom.xml" emacs blog)
("https://marcus3santos.github.io/index.xml" emacs blog)
("https://olddeuteronomy.github.io/index.xml" emacs blog)
("https://www.colinmclear.net/posts/index.xml" research emacs blog)
("https://howardism.org/index.xml" emacs blog)
("https://www.timmons.dev/rss.xml" lisp blog)
("https://batsov.com/atom.xml" lisp emacs blog)
("https://notes.eatonphil.com/rss.xml" lisp emacs blog)
("https://stackoverflow.com/feeds/tag?tagnames=hunchentoot&sort=newest" lisp stackoverflow)
("https://stackoverflow.com/feeds/tag?tagnames=common-lisp&sort=newest" lisp stackoverflow)
("https://stackoverflow.com/feeds/tag?tagnames=elisp&sort=newest" lisp emacs stackoverflow)
("https://stackoverflow.com/feeds/tag?tagnames=org-mode&sort=newest" emacs orgmode stackoverflow)
("https://stackoverflow.com/feeds/tag?tagnames=xmpp&sort=newest" xmpp stackoverflow)
;;("https://stackoverflow.com/feeds/tag?tagnames=postgresql&sort=newest" sql stackoverflow)
;;("https://stackoverflow.com/feeds/tag?tagnames=mariadb&sort=newest" sql stackoverflow)
("https://stackoverflow.com/feeds/tag?tagnames=guile&sort=newest" guile scheme lisp stackoverflow)
("https://stackoverflow.com/feeds/tag?tagnames=sbcl&sort=newest" sbcl lisp stackoverflow)
("https://stackoverflow.com/feeds/tag?tagnames=sbcl+emacs&sort=newest" sbcl emacs lisp stackoverflow)
("https://stackoverflow.com/feeds/tag?tagnames=sbcl+common-lisp+linux&sort=newest" sbcl lisp linux stackoverflow)
("https://sourceforge.net/p/sbcl/activity/feed" lisp sbcl)
("https://fukamachi.hashnode.dev/rss.xml" lisp blog)
("https://sourceforge.net/projects/sbcl/rss?path=/sbcl" lisp sbcl sourceforge)
("https://threatpost.com/feed/" security)
("https://krebsonsecurity.com/feed/" security blog)
("https://www.schneier.com/feed/atom/" security blog)
("https://www.nngroup.com/feed/rss/" ux design)
("https://feedpress.me/UXmatters" ux design)
("https://uxmovement.com/feed" ux design)
("https://www.uxbeginner.com/feed/" ux design)
("https://jeffgothelf.com/feed/" lean ux design blog)
("https://uxwritinghub.com/feed/" ux writing blog)
("https://www.w3.org/WAI/feed.xml" ux wai aria w3c)
("https://measuringu.com/feed/" ux blog)
("https://ux.stackexchange.com/feeds" ux stackexchange)
("https://emacs.stackexchange.com/feeds" emacs stackexchange)
("https://www.mdr.de/nachrichten/podcast/general/russland-angriff-krieg-ukraine100-podcast.xml" krieg ukraine podcast)
2024-10-31 09:32:30 +01:00
("https://www.mdr.de/nachrichten/podcast/kekule-corona/kompass-104-podcast.xml" podcast gesundheit)
("https://www.mdr.de/nachrichten/podcast/kemfert-klima/klimawandel-aktuell-klimapolitik-100-podcast.xml" podcast klima)
("https://www.deutschlandfunk.de/umwelt-und-verbraucher-100.rss" umwelt verbraucher klima podcast)
("https://jung-naiv.podigee.io/feed/mp3" politik podcast)
("https://www.ndr.de/nachrichten/info/podcast4696.xml" podcast umwelt klima)
("https://ct-uplink.podigee.io/feed/mp3" podcast technik computer)
("https://feeds.soundcloud.com/users/soundcloud:users:261098918/sounds.rss" podcast osint)
("https://hacks.mozilla.org/feed/" blog firefox web)
("https://karthinks.com/index.xml" blog emacs)
("https://www.destatis.de/SiteGlobals/Functions/RSSFeed/DE/RSSNewsfeed/Aktuell.xml" destatis aktuelles presse)
("http://www.umweltbundesamt.de/rss/presse" uba aktuelles presse)
("https://www.test.de/rss/geldanlage-banken/" test geld finanzen)
("https://www.test.de/rss/steuern-recht/" test steuern recht)
("https://thefetishistas.com/feed/" latex fetish news)
("https://tonsky.me/atom.xml" blog computer)
("https://www.copernicus.eu/news/rss" klima)
("https://gegenblende.dgb.de/@@rss?count=10&feed=b3b8f76e-53f1-11e6-a380-525400e5a74a" arbeit gewerkschaft news)
("https://drewdevault.com/blog/index.xml" blog programming computer)
("https://inkppl.com/en/rss.xml" tattoo magazin people culture)
("https://novaramedia.com/feed/" politics capitalism climate left media)
("https://www.youtube.com/feeds/videos.xml?channel_id=UCN29LJGZ8FY30ysxdTnDsaw" youtube video)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC5Ghe5TBQGYIOANuiNW4hDQ" youtube video)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC0p5jTq6Xx_DosDFxVXnWaQ" youtube video)
("https://www.youtube.com/feeds/videos.xml?channel_id=UC0p5jTq6Xx_DosDFxVXnWaQ" youtube video)
("https://www.vag.de/rss/meldungen" ubahn opnv vag)
("https://feeds.feedblitz.com/sethsblog" management author blog)
("https://ourworldindata.org/atom-data-insights.xml" data world)
("https://ourworldindata.org/atom.xml" data world)
("https://www.amazon.science/index.rss" science blog amazon data)
("https://feed.theregister.com/atom?a=Liam%20Proven" register foss)
("https://benswift.me/feed.xml" blog creative technology emacs computing)
2024-09-26 20:10:27 +02:00
("https://media.rss.com/l0wl1f3podcast/feed.xml" cyberpunk podcast)
2024-09-30 13:46:46 +02:00
("https://sachachua.com/blog/feed/" emacs blog lisp programming)
2024-10-07 10:33:19 +02:00
("https://peertube.tv/feeds/videos.xml?videoChannelId=3483" lisp video)
2024-10-11 10:09:49 +02:00
("https://www.youtube.com/feeds/videos.xml?channel_id=UCYg6qFXDE5SGT_YXhuJPU0A" programming video lisp)
2024-11-03 11:29:45 +01:00
("https://frame.work/de/de/blog.rss" framework laptop blog company)
2024-11-09 11:16:46 +01:00
("https://en.opensuse.org/api.php?hidebots=1&urlversion=1&days=7&limit=50&action=feedrecentchanges&feedformat=atom" linux wiki opensuse)
2024-11-27 12:14:16 +01:00
("https://codeberg.org/SystemCrafters/systemcrafters-site/rss/branch/master/publish.el" emacs)
))
:custom
(elfeed-search-filter "@7-day-ago +unread")
:config
2024-11-09 15:53:34 +01:00
;; Play videos from elfeed
(defun elfeed-mpv (&optional use-generic-p)
"Play video link with mpv."
(interactive "P")
(let ((entries (elfeed-search-selected)))
(cl-loop for entry in entries
do (elfeed-untag entry 'unread)
when (elfeed-entry-link entry)
do (start-process-shell-command "elfeed-video" nil (format "mpv \"%s\"" it)))
(mapc #'elfeed-search-update-entry entries)
(unless (use-region-p) (forward-line))))
2024-08-25 09:42:16 +02:00
(let ((feeds (expand-file-name "~/feeds.el")))
(when (file-exists-p feeds)
2024-11-09 15:53:34 +01:00
(load-file feeds)))
:bind (("C-x w" . elfeed)
:map elfeed-search-mode-map
("v" . 'elfeed-mpv)
("U" . 'elfeed-update)))
2024-08-25 09:42:16 +02:00
;; (load "bundle--calendar")
(setq holiday-oriental-holidays nil)
(setq holiday-islamic-holidays nil)
(setq holiday-bahai-holidays nil)
(setq holiday-hebrew-holidays nil)
(setq holiday-general-holidays
'((holiday-fixed 1 1 "Neujahr")
(holiday-fixed 5 1 "1. Mai")
(holiday-fixed 10 3 "Tag der Deutschen Einheit")))
(setq holiday-christian-holidays
'((holiday-float 12 0 -4 "1. Advent" 24)
(holiday-float 12 0 -3 "2. Advent" 24)
(holiday-float 12 0 -2 "3. Advent" 24)
(holiday-float 12 0 -1 "4. Advent" 24)
(holiday-fixed 12 25 "1. Weihnachtstag")
(holiday-fixed 12 26 "2. Weihnachtstag")
(holiday-fixed 1 6 "Heilige Drei Könige")
(holiday-easter-etc -48 "Rosenmontag")
;; (holiday-easter-etc -3 "Gründonnerstag")
(holiday-easter-etc -2 "Karfreitag")
(holiday-easter-etc 0 "Ostersonntag")
(holiday-easter-etc +1 "Ostermontag")
(holiday-easter-etc +39 "Christi Himmelfahrt")
(holiday-easter-etc +49 "Pfingstsonntag")
(holiday-easter-etc +50 "Pfingstmontag")
(holiday-easter-etc +60 "Fronleichnam")
(holiday-fixed 8 15 "Mariae Himmelfahrt")
(holiday-fixed 11 1 "Allerheiligen")
;; (holiday-float 11 3 1 "Buss- und Bettag" 16)
(holiday-float 11 0 1 "Totensonntag" 20)))
(use-package calendar
:ensure nil
:config
(setq calendar-latitude 49.4)
(setq calendar-longitude 11.0)
(setq calendar-location-name "Nuremberg, DE")
:custom
(european-calendar-style t)
(calendar-christian-all-holidays-flag t)
(calendar-date-style (quote iso))
(calendar-view-diary-initially-flag t)
(calendar-week-start-day 1)
(calendar-intermonth-text
'(propertize
(format "%2d"
(car
(calendar-iso-from-absolute
(calendar-absolute-from-gregorian
(list month day year )))))
'font-lock-face 'font-lock-function-name-face)))
;; (load "bundle--email")
(setq mml-default-sign-method "pgpmime"
mml-default-encrypt-method "pgpmime"
mml-secure-openpgp-sign-with-sender t
mail-user-agent 'message-user-agent
compose-mail-user-agent-warnings nil)
(defun mk/sign-email ()
;; Sign an Email using the key of the sender.
(interactive)
(mml-secure-message-sign-pgpmime))
(defun mk/encrypt-email ()
;; Encrypt an Email using the key of the recipient.
(interactive)
(mml-secure-message-encrypt-pgpmime))
(defvar mk/gps-location
(eval '(let ((float-output-format "%.1f"))
(format "%s%s, %s%s"
(if (numberp calendar-latitude)
(abs calendar-latitude)
(+ (aref calendar-latitude 0)
(/ (aref calendar-latitude 1) 60.0)))
(if (numberp calendar-latitude)
(if (> calendar-latitude 0) "N" "S")
(if (eq (aref calendar-latitude 2) 'north) "N" "S"))
(if (numberp calendar-longitude)
(abs calendar-longitude)
(+ (aref calendar-longitude 0)
(/ (aref calendar-longitude 1) 60.0)))
(if (numberp calendar-longitude)
(if (> calendar-longitude 0) "E" "W")
(if (eq (aref calendar-longitude 2) 'east) "E" "W"))))))
(defvar mk/signature-name
(concat "Cheers, "
user-full-name
" ("
calendar-location-name
", "
mk/gps-location
")\n"))
(defvar mk/signature-gpg "GnuPG Key: https://meta.sr.ht/~marcuskammer.pgp\nFingerprint: 86DB 0F30 F9F1 661A 54E2 1664 C374 817B E285 268F")
(defun mk/signature-time ()
(format-time-string "Written on: %a, %d %b %Y %R %z\n"))
(defun mk/signature ()
(concat
;;mk/signature-name
;;(mk/signature-time)
mk/signature-gpg))
(use-package smtpmail
:custom
(smtpmail-smtp-server "smtp.mailbox.org")
(smtpmail-smtp-service 465)
(smtpmail-stream-type 'ssl)
(smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg")))
(add-hook 'message-signature-setup-hook (lambda () (setf message-signature (mk/signature))))
;; (add-hook 'mail-send-hook #'ispell-message)
;; (add-hook 'message-send-hook #'ispell-message)
(add-hook 'message-mode-hook 'turn-on-auto-fill)
(setq message-directory "~/Maildir")
(setq message-auto-save-directory "~/Maildir/Drafts")
(setq message-send-mail-function 'smtpmail-send-it)
(use-package gnus
2024-09-20 08:36:37 +02:00
:defer t
2024-08-25 09:42:16 +02:00
:custom
(gnus-use-full-window nil)
(gnus-summary-line-format "%O%U%R%z%d %B%(%[%4L: %-22,22f%]%) %s\n")
(gnus-summary-mode-line-format "Gnus: %p [%A / Sc:%4z] %Z")
(gnus-summary-same-subject "")
(gnus-summary-make-false-root 'adopt)
(gnus-summary-make-false-root-always nil)
(gnus-sum-thread-tree-indent " ")
(gnus-sum-thread-tree-root "* ")
(gnus-sum-thread-tree-false-root "")
(gnus-sum-thread-tree-single-indent "")
(gnus-sum-thread-tree-leaf-with-other "+-+> ")
(gnus-sum-thread-tree-vertical "|")
(gnus-sum-thread-tree-single-leaf "=--> ")
(gnus-thread-sort-functions '(gnus-thread-sort-by-subject gnus-thread-sort-by-most-recent-date))
(gnus-large-newsgroup nil)
(gnus-inhibit-startup-message t)
(gnus-check-new-newsgroups nil)
(gnus-select-method '(nnnil ""))
(gnus-secondary-select-methods
'((nntp "news.eternal-september.org"
(nntp-open-connection-function nntp-open-ssl-stream)
(nntp-port-number 563)
(nntp-authinfo-file "~/.authinfo.gpg"))
(nnimap "mailbox"
(nnimap-address "imap.mailbox.org")
(nnimap-inbox "INBOX")
(nnimap-server-port 993)
(nnimap-stream ssl)
(nnimap-authinfo-file "~/.authinfo.gpg"))))
:config
(add-hook 'gnus-summary-prepare-hook 'gnus-summary-sort-by-most-recent-date))
(when (eq system-type 'gnu/linux)
(let ((mu4e-dir (expand-file-name "/usr/share/emacs/site-lisp/mu4e/")))
(when (file-directory-p mu4e-dir)
(add-to-list 'load-path mu4e-dir)
(use-package mu4e
:ensure nil
:hook (mu4e-compose-pre . (lambda () (setf mu4e-compose-signature (mk/signature))))
:custom
(mu4e-confirm-quit nil)
(mu4e-change-filenames-when-moving t)
(mu4e-drafts-folder "/Drafts")
(mu4e-get-mail-command "mbsync -a")
(mu4e-headers-date-format "%Y-%m-%d %H:%M")
(mu4e-refile-folder "/Archive")
(mu4e-sent-folder "/Sent")
(mu4e-trash-folder "/Trash")
(mu4e-split-view 'horizontal)
(mu4e-update-interval (* 10 60))))))
;; (load "bundle--org")
(use-package org
:ensure nil
2024-09-20 08:36:37 +02:00
:defer t
2024-08-25 09:42:16 +02:00
:hook ((org-mode . turn-on-auto-fill))
:init (org-clock-persistence-insinuate)
:bind
(("C-c l" . org-store-link)
("C-c a" . org-agenda)
("C-c c" . org-capture)
("C-c b" . org-switchb))
:init
2024-09-20 08:36:37 +02:00
;; (org-babel-lob-ingest "~/.emacs.d/library-of-babel.org")
2024-08-25 09:42:16 +02:00
(setq org-capture-templates '())
:custom
(abbrev-suggest t)
(org-hide-block-startup t)
(org-hide-emphasis-markers nil)
(org-default-notes-file "notes.org")
(org-insert-mode-line-in-empty-file t)
(org-adapt-indentation nil)
(org-agenda-prefix-format
'((agenda . " %i %-12:c%?-12t%-6e% s")
(todo . " %i %-12:c %-6e")
(tags . " %i %-12:c")
(search . " %i %-12:c")))
(org-agenda-dim-blocked-tasks nil)
(org-agenda-inhibit-startup nil)
(org-agenda-span 14)
(org-agenda-start-on-weekday 1)
(org-agenda-include-diary t)
2024-09-06 18:31:02 +02:00
(org-attach-dir-relative nil)
2024-09-06 09:05:31 +02:00
(org-attach-auto-tag nil)
(org-attach-archive-delete t)
2024-09-06 18:31:02 +02:00
(org-attach-use-inheritance nil)
2024-08-25 09:42:16 +02:00
(org-clock-out-remove-zero-time-clocks t)
(org-clock-persist t)
(org-clock-rounding-minutes 30)
(org-confirm-babel-evaluate nil)
(org-duration-format (quote h:mm))
(org-export-dispatch-use-expert-ui nil)
(org-export-default-language "en")
(org-export-with-smart-quotes t)
(org-export-with-emphasize t)
(org-export-with-special-strings t)
(org-export-with-fixed-width t)
(org-export-with-timestamps nil)
(org-export-preserve-breaks nil)
(org-export-with-sub-superscripts nil)
(org-export-with-archived-trees nil)
(org-export-with-author t)
(org-export-with-broken-links t)
(org-export-with-clocks nil)
(org-export-with-creator nil)
(org-export-with-drawers nil)
(org-export-with-date t)
(org-export-with-entities t)
(org-export-with-email t)
(org-export-with-footnotes t)
(org-export-headline-levels 3)
(org-export-with-inlinetasks nil)
(org-export-with-section-numbers t)
(org-export-with-planning nil)
(org-export-with-priority nil)
(org-export-with-properties nil)
(org-export-with-statistics-cookies nil)
(org-export-with-tags nil)
2024-11-12 08:49:56 +01:00
(org-export-with-tasks 'done)
2024-08-25 09:42:16 +02:00
(org-export-with-latex t)
(org-export-time-stamp-file nil)
(org-export-with-title t)
(org-export-with-toc t)
(org-export-with-todo-keywords nil)
(org-export-with-tables t)
(org-export-date-timestamp-format "%a, %d %b %Y %R %z")
(org-export-backends '(ascii html latex md odt texinfo))
(org-global-properties '(("EFFORT_ALL" . "0:30 1:00 2:00 3:00 5:00 8:00")))
(org-html-doctype "html5")
(org-html-html5-fancy t)
2024-09-06 18:31:02 +02:00
(org-html-head-include-default-style nil)
2024-08-25 09:42:16 +02:00
(org-log-done (quote time))
(org-refile-targets '((nil :maxlevel . 3)))
(org-startup-folded t)
(org-startup-truncated nil)
(org-src-fontify-natively t)
(org-src-tab-acts-natively t)
(org-src-window-setup 'other-window)
2024-11-17 10:50:14 +01:00
(org-time-stamp-rounding-minutes '(0 5))
2024-08-25 09:42:16 +02:00
(org-todo-keywords
'((sequence "TODO" "DOING(!)" "DONE(!)")
(sequence "RECRUIT" "INTERVIEW" "QDA" "DOC" "REVIEW")))
(org-use-property-inheritance nil)
(org-attach-store-link-p 'attached)
(org-agenda-custom-commands
'(("p" "Projects"
((tags "PROJECT")))))
2024-10-28 16:48:48 +01:00
(org-latex-packages-alist nil)
2024-08-25 09:42:16 +02:00
;; Define the process to convert Org to PDF using XeLaTeX
(org-latex-pdf-process '("latexmk -lualatex -shell-escape -quiet -f %f"))
;; Set the compiler to XeLaTeX
(org-latex-compiler "lualatex")
(org-latex-tables-booktabs t)
(org-latex-images-centered t)
;; Enable listings and other table-related features
2024-10-28 16:48:48 +01:00
(org-latex-listings nil)
2024-10-17 09:26:17 +02:00
(org-latex-src-block-backend 'listings)
2024-08-25 09:42:16 +02:00
;; Customize the appearance of listings (source code blocks)
2024-10-28 16:48:48 +01:00
(org-latex-listings-options nil)
2024-08-25 09:42:16 +02:00
(org-latex-inputenc-alist '((\"utf8\" . \"utf8x\")))
:config
(add-to-list 'org-file-apps '("\\.pdf\\'" . emacs))
2024-08-25 09:42:16 +02:00
(if (eq system-type 'windows-nt)
(setq org-babel-python-command "python")
(setq org-babel-python-command "python3"))
(setq time-stamp-active t
time-stamp-start "#\\+[dD][aA][tT][eE]: [\t]*"
time-stamp-end "$"
time-stamp-inserts t
time-stamp-format "[%Y-%m-%d %H:%M]")
(add-hook 'before-save-hook 'time-stamp nil)
;; (when (eq system-type 'windows-nt)
;; (setq org-babel-sqlite3-command "c:/msys64/ucrt64/bin/sqlite3.exe"))
2024-10-30 08:46:31 +01:00
;; (org-babel-library-of-babel "~/.emacs.d/library-of-babel.org")
2024-08-25 09:42:16 +02:00
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(lisp . t)
(gnuplot . t)
(python . t)
(sqlite . t)
(shell . t)
(plantuml . t)
(C . t)
(js . t)
2024-09-20 08:41:35 +02:00
(scheme . t)
(dot . t)))
2024-08-25 09:42:16 +02:00
;; work with org-agenda dispatcher [c] "Today Clocked Tasks" to view today's clocked tasks.
2024-09-07 19:29:34 +02:00
:custom-face
(org-tag ((t (:weight normal :height 0.8))))
2024-10-07 10:33:06 +02:00
(org-level-1 ((t (:slant italic :inherit outline-1 :height 1.5))))
2024-09-26 18:16:40 +02:00
(org-level-2 ((t (:slant italic :inherit outline-2 :height 1.4))))
2024-10-07 10:33:06 +02:00
(org-level-3 ((t (:slant italic :inherit outline-3 :height 1.3))))
(org-level-4 ((t (:slant italic :inherit outline-4 :height 1.2))))
(org-level-5 ((t (:slant italic :inherit outline-5 :height 1.1)))))
2024-08-25 09:42:16 +02:00
;; Define custom LaTeX class with specific formatting
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("koma-general"
2024-11-06 11:35:49 +01:00
"\\documentclass[a4paper,10pt,captions=tableheading,twoside=false]{scrartcl}
% ~/.emacs.d/texmf/tex/latex/mycustomstyles/
\\usepackage{komageneral}"
2024-08-25 09:42:16 +02:00
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
2024-11-06 11:35:49 +01:00
2024-08-25 09:42:16 +02:00
(setq org-latex-default-class "koma-general"))
(setq org-html-protect-char-alist
'(("&" . "&amp;")
("<" . "&lt;")
(">" . "&gt;")
(":lambda:" . "&#955;")
(":python:" . "&#128013;")
(":whale:" . "&#128051;")
(":turtle:" . "&#x1f422;")
(":dash:" . "&#x1f4a8;")
(":party:" . "&#129395;")
(":see-no-evil:" . "&#128584;")
(":cloud:" . "&#9729;&#65039;")
(":abacus:" . "&#129518;")
(":desktop:" . "&#128421;&#65039;")
(":rocket:" . "&#128640;")
(":unicorn:" . "&#129412;")
(":recycling:" . "&#9851;")
(":crystalball:" . "&#128302;")
(":photography:" . "&#128247;")
(":money:" . "&#128181;")
(":-)" . "&#x1f60a;")
(":-(" . "&#x1f61e;")))
(require 'request)
(use-package org-roam
:defer t
2024-08-25 09:42:16 +02:00
:after org
:init
2024-11-17 10:50:30 +01:00
(org-roam-db-autosync-mode)
2024-08-25 09:42:16 +02:00
(setq org-roam-v2-ack t)
(setq org-roam-db-location "~/org-roam.db")
(require 'org-roam-dailies)
:bind (("C-c r l" . org-roam-buffer-toggle)
("C-c r f" . org-roam-node-find)
("C-c r g" . org-roam-graph)
("C-c r i" . org-roam-node-insert)
("C-c r c" . org-roam-capture)
("C-c r j" . org-roam-dailies-map)
:map org-roam-dailies-map
("t" . org-roam-dailies-capture-today)
("y" . org-roam-dailies-capture-yesterday)
("T" . org-roam-dailies-capture-tomorrow)
:map org-mode-map
("C-M-i" . completion-at-point))
:custom
(org-roam-completion-everywhere nil)
(org-roam-dailies-capture-templates
'(("d" "default" entry "* %<%R> %?"
:if-new (file+head "%<%F>.org" "#+title: %<%F>\n"))))
(org-roam-capture-templates
'(("d" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("r" "Research" plain
"* Hypothesis:\n%?\n* Methodology:\n* Results:\n* Conclusions:\n"
:if-new (file+head "research/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("m" "Meeting" plain
"* Participants:\n%?\n* Discussion topics:\n* Action points:\n"
:if-new (file+head "meetings/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("p" "Project" plain
"* Goals:\n%?\n* Milestones:\n* Resources:\n"
:if-new (file+head "projects/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("l" "Literature" plain
"* Authors:\n%?\n* Main theses:\n* Own thoughts:\n"
:if-new (file+head "literature/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
2024-11-07 13:07:33 +01:00
:unnarrowed t)
("u" "user story" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+filetags: :user-story:\n#+created: %U\n#+last_modified: %U\n\n* Story Overview\n\n* Acceptance Criteria\n** Given [context]\n- When [action]\n- Then [expected outcome]\n\n** Given [context]\n- When [action]\n- Then [expected outcome]\n\n* Implementation Details\n** Technical Notes\n- [ ]\n\n** UI/UX Considerations\n- [ ]\n\n* Validation\n** Test Scenarios\n- [ ]\n\n** Definition of Done\n- [ ] Meets all acceptance criteria\n- [ ] Code reviewed\n- [ ] Tests written and passing\n- [ ] Documentation updated\n- [ ] UX review completed\n- [ ] Product owner sign-off\n\n* INVEST Checklist\n- [ ] Independent: Can this story be delivered independently?\n- [ ] Negotiable: Is there room for discussion about implementation?\n- [ ] Valuable: Does this deliver clear value to the user?\n- [ ] Estimable: Do we have enough information to estimate the work?\n- [ ] Small: Can this be completed in one sprint?\n- [ ] Testable: Do we have clear acceptance criteria?\n\n* References\n** Related Documents\n- Links: [[]]\n- Documentation: [[]]\n\n** Discussion Notes\n#+begin_quote\nRecord important discussions or decisions here\n#+end_quote\n\n")
2024-08-25 09:42:16 +02:00
:unnarrowed t))))
2024-10-28 16:49:04 +01:00
(use-package org-roam-ui
:after org-roam
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
2024-08-25 09:42:16 +02:00
(use-package org-tree-slide
:bind ("<f5>" . org-tree-slide-mode)
:custom
(org-image-actual-width nil))
(use-package org-web-tools
:defer t
:custom (org-web-tools-pandoc-sleep-time 0.4))
;; (use-package ob-go
;; :after org)
(use-package ox-reveal
:after org)
;; (use-package ox-pandoc
;; :after org
;; :custom
;; (org-pandoc-options-for-beamer-pdf '((pdf-engine . "xelatex"))))
;; (defun me/write-readme-md-on-save ()
;; ;; when README.org, also write README.md on save
;; (when (string-match "README" (buffer-file-name))
;; (make-local-variable 'after-save-hook)
;; (add-hook 'after-save-hook
;; (lambda () (let ((outfile (org-export-output-file-name ".md")))
;; (org-export-to-file 'md outfile))))))
;; (add-hook 'org-mode-hook 'me/write-readme-md-on-save)
;; (use-package ob-go
;; :after org
;; :config
;; (append '((go . t)) org-babel-load-languages))
(use-package ob-http
:after org
:config
(append '((http . t)) org-babel-load-languages))
2024-10-26 14:40:16 +02:00
(use-package company
:config (global-company-mode))
2024-10-31 14:20:56 +01:00
(use-package company-shell
2024-10-31 07:53:14 +01:00
:after company)
2024-10-31 14:20:56 +01:00
(use-package company-terraform
:after (company terraform)
:config (company-terraform-init))
(use-package company-quickhelp
:after company
:config (company-quickhelp-mode))
2024-09-09 13:55:15 +02:00
(when (eq system-type 'windows-nt)
(use-package ob-powershell
:after org))
2024-11-18 20:31:54 +01:00
(use-package kotlin-mode
:mode "\\.kt\\'")
2024-08-25 09:42:16 +02:00
;; (use-package ob-racket
;; :after org
;; :pin manual
;; :config
;; (append '((racket . t) (scribble . t)) org-babel-load-languages))
;; (use-package ox-rss
;; :after org)
;; (use-package ob-restclient
;; :after org
;; :config
;; (append '((restclient . t)) org-babel-load-languages))
(let ((bundle-dir (expand-file-name "~/.emacs.d/bundle/")))
(when (file-directory-p bundle-dir)
(add-to-list 'load-path bundle-dir)
2024-10-11 10:09:54 +02:00
(load "bundle--ct")
(load "bundle--mk")))