;;; bandali-prog.el --- programming modes setup -*- lexical-binding: t; -*- ;; Copyright (c) 2018-2025 Amin Bandali ;; Author: Amin Bandali ;; Keywords: languages ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; My customizations for various programming language modes. ;;; Code: ;; `elisp-mode' (b/keymap-global-set "C-c e e" #'eval-last-sexp) ;; `pp' (b/keymap-global-set "C-c e m" #'pp-macroexpand-last-sexp) ;; `lisp-mode' (add-hook 'lisp-interaction-mode-hook #'b/setq-local-indent-tabs-mode-nil) ;; (add-to-list 'load-path (b/lisp "alloy-mode")) ;; (with-eval-after-load 'alloy-mode ;; (setq alloy-basic-offset 2) ;; (defun b/alloy-simple-indent (start end) ;; (interactive "r") ;; ;; (if (region-active-p) ;; ;; (indent-rigidly start end alloy-basic-offset) ;; ;; (if (bolp) ;; ;; (indent-rigidly (line-beginning-position) ;; ;; (line-end-position) ;; ;; alloy-basic-offset))) ;; (indent-to (+ (current-column) alloy-basic-offset))) ;; (define-key alloy-mode-map (kbd "RET") #'electric-newline-and-maybe-indent) ;; ;; (define-key alloy-mode-map (kbd "TAB") #'b/alloy-simple-indent) ;; (define-key alloy-mode-map (kbd "TAB") #'indent-for-tab-command)) ;; (unless (fboundp 'alloy-mode) ;; (autoload #'alloy-mode "alloy-mode" nil t)) ;; (add-to-list 'auto-mode-alist '("\\.\\(als\\|dsh\\)\\'" . alloy-mode)) ;; (add-hook 'alloy-mode-hook #'b/setq-local-indent-tabs-mode-nil) ;; (eval-when-compile (defvar lean-mode-map)) ;; (run-with-idle-timer 0.4 nil #'require 'lean-mode) ;; (with-eval-after-load 'lean-mode ;; (require 'lean-input) ;; (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 (setopt sgml-basic-offset 0)) (with-eval-after-load 'css-mode (setopt css-indent-offset 2)) ;; `cmake-mode' (with-eval-after-load 'cmake-mode (add-to-list 'load-path (b/emacs.d "lisp/cmake-font-lock")) (require 'cmake-font-lock)) (unless (fboundp 'cmake-mode) (autoload #'cmake-mode "cmake-mode" nil t)) (add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode)) (add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-mode)) ;; `reftex' (add-hook 'latex-mode-hook #'reftex-mode) (provide 'bandali-prog) ;;; bandali-prog.el ends here