;;; gungadin.el - Loads Emacs Lisp files ;; Version 1.0 ;; Copyright 2017 Matematiker Christopher Dimech ;; This file forms part of Behistun, a Gnu Package. ;; @rec ;; File: gungadin.el ;; Brief: Loads Emacs Lisp files for Emacs Customisation. ;; FileVers: 1.0 ;; Copyright: 2017 Matematiker Christopher Dimech ;; License: Gnu Affero General Public License (Gnu AGPL) ;; LicVers: Version 3 or any later version. ;; Author: Christopher Dimech ;; Keywords: Elisp ;; @end rec ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ;;; Copying Conditions ;; ___ ___ _ ;; / __|_ __ _ _ / __|___ _ _ __| |_ __ ;; | (__| '_ \ || | | (__/ _ \ ' \/ _` \ \ / ;; \___| .__/\_, | \___\___/_||_\__,_/_\_\ ;; |_| |__/ ;; This file is part of Behistena Gnu Package. ;; Gnu Behistun is free software; you can redistribute it and/or modify ;; it under the terms of the Gnu Affero General Public License as ;; published by the Free Software Foundation, either version 3 of the ;; License, or (at your option) any later version. ;; This file 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 ;; Affero General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this file. A copy of the license is included in the ;; file entitled "gnu--agpl.texi". If not, see ;; . ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ;;; Commentary: ;; @rec ;; Subject: Byte Compilation ;; Brief: The Byte Compiler makes emacs run faster by translating ;; + lisp commands into Byte-Code Representation in a file with .elc ;; + extension. The .elc file can then be read by the Byte-Code ;; + Interpreter. ;; Detail: Byte compilation will show helpful error and warning messages ;; Example: M-x byte-compile-file gungadin.el ;; Example: (byte-compile-file "gungadin.el") ;; Example: Byte compile newer .el files compared to .elc files. ;; + (byte-recompile-directory ".") ;; Example: Byte compile .el file when .elc file does not exist. ;; + (byte-recompile-directory "." 0) ;; Example: Lists information about block devices ;; + lsblk ;; Example: Checking and repairing a filesystem ;; + sudo fsck -y /dev/sdc1 ;;; Code: ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @rec ;; Define: multic, keytrigger-text-scale ;; Brief: [1] Enables multi-line comments; [2] Changes the height of ;; + the default text typeface. ;; @end rec (defmacro multic (&rest _)) (defvar mydoc "foobar") (defun aoe (x) (:documentation mydoc) (+ x 42)) ;;(aoe 5) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun defun-detail (fname detail) "Put DETAIL in function-documentation property of FNAME. Usage: (defun-detail 'fname 'detail)" (put fname 'function-documentation detail)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (multic " #+STARTUP: content * Defvar: Buffer name, version, license ** gungadin-bufr-name") (defvar gungadin-bufr-name "*Gungadin*") ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (multic " ** Defvar: gungadin-version-license") (defvar gungadin-version-license "Gungadin 1.0 of 2017-05-02 Gungadin is part of Behistun, a Gnu Package. Copyright (C) 2017 Christopher Dimech Author: Christopher Dimech Gungadin is Free Software, software that fully respects the computing freedom of its users as defined by the Free Software Foundation. See `(url-link https://www.gnu.org/philosophy/philosophy.html)'. You can redistribute exact copies of Gungadin or modify it under the terms of the Gnu Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.") ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (multic " ** gungadin-guidance-message") (defvar gungadin-guidance-message "M-x finder-commentary Displays elisp file commentary section. C-h f flight\n") ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (multic " * Make buffer and startup ** gungadin-bufr-insert") (defun gungadin-bufr-insert (message) "Inserts formatted string into the Gungadin Dedicated Buffer." (with-current-buffer (get-buffer-create gungadin-bufr-name) (insert message)) ) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (multic " * gungadin-inhibit-windows") ;;; * gungadin-inhibit-windows (defvar startup-windows-kondor 0) (defun gungadin-inhibit-windows () "Inhibits emacs startup windows. Startup windows provide information about copyleft and basic emacs usage." (setq inhibit-startup-screen t) (add-hook 'emacs-startup-hook (lambda () (delete-other-windows)) t) ) ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (multic " ** gungadin-debug-sweep") ;;; * gungadin-debug-sweep ;; _ _ ;; ___ _ __ __ _ __ ___ __| |___| |__ _ _ __ _ _ _ ;; / -_) ' \/ _` / _(_-< / _` / -_) '_ \ || / _` | '_| ;; \___|_|_|_\__,_\__/__/ \__,_\___|_.__/\_,_\__, |_| ;; |___/ ;; @rec ;; Defvar: gungadin-debug-kondor ;; Brief: Instructs how the lisp debugger behaves when errors happen. ;; Defun: gungadin-debug-sweep, gungadin-launch-debug, ;; Defun: keytrigger-text-scale ;; Brief: [1] Provides ways to enter the debugger; [2] Easy way ;; + to launch the lisp debugger; [3] Changes text height. ;; @end rec ;; toggle-debug-on-error (defvar gungadin-debug-sweep-kondor 0) (defun gungadin-debug-sweep () "Enables the Emacs Debugger." (interactive) (pcase gungadin-debug-sweep-kondor ;; ---------------------------------------------------------------- (1 ; enter debug mode on error (setq debug-on-error t) ; some errors ignored (message "(+) debug-on-error") (setq gungadin-debug-sweep-kondor 2)) ;; ---------------------------------------------------------------- (2 ; add dubug of ignored errors (setq debug-on-error t) (setq debug-ignored-errors t) (message "[debug-on-error] (+) debug-ignored-errors") (setq gungadin-debug-sweep-kondor 3)) ;; ---------------------------------------------------------------- (3 ; debugs all errors (setq debug-on-error t) (setq debug-ignored-errors t) (setq debug-on-message "unescaped character literals") (message "[debug-on-error] (+) debug-ignored-errors") (message "[debug-on-error] (+) debug-on-message") (setq gungadin-debug-sweep-kondor 4) ) ;; ---------------------------------------------------------------- (_ ; normal operation - no debug (setq debug-on-error nil) (message "(-) debug-on-error") (setq gungadin-debug-sweep-kondor 1)) )) ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (multic " ** gungadin-debug-launch") ;;; * gungadin-debug-launch (defun gungadin-debug-launch () "Debugging gungadin SEL Selection" (gungadin-debug-sweep)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (multic " * keytrigger-text-scale") ;;; * gungadin-text-scale-keytrigger ;; _ _ _ ;; | |_ _____ _| |_ ___ __ __ _| |___ ;; | _/ -_) \ / _| (_-= elbaite-kondor (length elbaite-colours)) (setq elbaite-kondor 0)) (set-cursor-color (nth elbaite-kondor elbaite-colours)) (setq eckondor (+ 1 elbaite-kondor))) (internal-show-cursor nil (not (internal-show-cursor-p))) ) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; * gungadin-startup (multic " * gungadin-launch") ;; @rec ;; Function: gungadin-launch ;; Brief: Sets list of cursor colours and colour counter. ;; @end rec (defun gungadin-startup () "Sets the emacs startup." (setq initial-frame-alist '((width . 75) (height . 34)) ) (setq text-scale-mode-step 1.1) (set-face-attribute 'default nil :height 210) ; 21pt (set-face-attribute 'default nil :weight 'ultra-bold) (gungadin-colour-theme) ; launches dark modus-vivendi (global-set-key (kbd "") #'modus-themes-toggle) (message "[modus-themes] (+) modus-vivendi") (gungadin-speedbar) ; display speedbar (gungadin-automode) ; associate emacs mode (blink-cursor-timer-function) ; coloured blinking cursor (set-face-attribute 'region nil ; colour selected region :background "#660066" :foreground "#ffffff") ;; remove window travel indicator (setq mode-line-percent-position nil) (redraw-display) ) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (multic " * gungadin-break-line-sweep") ;;; ** gungadin-break-line-sweep ;; @rec ;; Function: gungadin-break-line-sweep ;; Brief: Expedites the breaking of long lines. ;; @end rec (defvar glienicker-brucke 0) ; default mark for case of user inaction (setq-default auto-fill-function 'do-auto-fill) (defun gungadin-break-line-sweep () "Breaks long lines using auto-fill tool." (interactive) (pcase glienicker-brucke ((or 'nil 0) (setq-default auto-fill-function 'nil) (setq comment-auto-fill-only-comments nil) (auto-fill-mode -1) (turn-off-auto-fill) (message "%s %s" "(-) Break line; kondor:" glienicker-brucke) (setq glienicker-brucke (+ glienicker-brucke 1)) ) (1 (setq fill-column 72) (setq comment-auto-fill-only-comments t) (auto-fill-mode 1) (message "%s %s" "(+) Break comments only; kondor:" glienicker-brucke) (setq glienicker-brucke (+ glienicker-brucke 1)) ) (_ (setq comment-auto-fill-only-comments nil) (auto-fill-mode 1) (message "%s %s" "(+) Break all long lines; kondor:" glienicker-brucke) (setq glienicker-brucke 0)) )) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (multic " * gungadin-keytrigger") ;;; * gungadin-keytrigger ;; @rec ;; Function: gungadin-keytrigger ;; Brief: Sets hotkey shortcuts for rapid launching of commands. ;; @end rec (defun gungadin-keytrigger () "Bypasses the need to call commands by name" ;; Cycles buffer read-only ;; (global-set-key (kbd "H-f b") #'read-only-ddd) ;; (global-set-key (kbd "H-f r") #'read-only-ddd) ;; Rapid file saving for dvorak key layout (global-set-key (kbd "M-s") (kbd "C-x C-s")) ;; automatically break long lines (setq-default auto-fill-function 'nil) ; auto-fill initially disabled (global-set-key (kbd "H-b") #'gungadin-break-line-sweep) ;; Complete group marks (setq skeleton-pair t) (global-set-key (kbd "`") 'skeleton-pair-insert-maybe) (global-set-key (kbd "'") 'skeleton-pair-insert-maybe) (global-set-key (kbd "\"") 'skeleton-pair-insert-maybe) (global-set-key (kbd "<") 'skeleton-pair-insert-maybe) (global-set-key (kbd "(") 'skeleton-pair-insert-maybe) (global-set-key (kbd "[") 'skeleton-pair-insert-maybe) (global-set-key (kbd "{") 'skeleton-pair-insert-maybe) ;; names and runs a terminal sub-shell to an emacs buffer (global-set-key (kbd "C-`") 'shell) ; `M-x shell' (add-hook 'shell-mode-hook 'rename-uniquely) ; `M-x rename-buffer' ;; change major mode of working buffer (global-set-key (kbd "H-1") #'gungadin-major-mode-sweep) ) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (multic " * gungadin-save-context") ;;; * gungadin-save-context ;; _ _ ;; ___ __ ___ _____ __ ___ _ _| |_ _____ _| |_ ;; (_- key. ;; 3. Go to package window, then hit install button, followed by the ;; key. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; gungadin.el ends here