From 4be897e92228d3c708c4667c841e67a60048d9e6 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 16 Apr 2024 22:29:42 +0630 Subject: (Emacs/elisp)~Clean up haskell-multiedit top --- Emacs/.config/emacs/elisp/haskell-multiedit.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/haskell-multiedit.el b/Emacs/.config/emacs/elisp/haskell-multiedit.el index 1dc857f..89aeb7b 100644 --- a/Emacs/.config/emacs/elisp/haskell-multiedit.el +++ b/Emacs/.config/emacs/elisp/haskell-multiedit.el @@ -1,4 +1,6 @@ -;;; haskell-multiedit.el --- Minor mode to edit and evaluate multi-line scripts of Haskell without making a file -*- lexical-binding: t; -*- +;;; haskell-multiedit.el --- Minor mode to edit and evaluate +;;; multi-line scripts of Haskell without making a file +;;; -*- lexical-binding: t; -*- ;; Copyright (C) 2021 Aryadev Chavali -- cgit v1.2.3-13-gbd6f From 198f8d57d806dc1e7f5186bab07490fa6340138f Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 18 Apr 2024 15:23:54 +0630 Subject: (Emacs/elisp/license)~Behavior when licence-choice is NIL Instead of defaulting to the Unlicense, we now completely copyright the material. This is the default behavior when a LICENSE is not attached to a project in open source: copyright is completely preserved. --- Emacs/.config/emacs/elisp/license.el | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/license.el b/Emacs/.config/emacs/elisp/license.el index 8ea64fd..5921d59 100644 --- a/Emacs/.config/emacs/elisp/license.el +++ b/Emacs/.config/emacs/elisp/license.el @@ -419,20 +419,22 @@ For more information, please refer to "))) (car (alist-get choice +license/licenses-alist "" nil #'string=)))) (defun +license/copyright-notice () - (let ((license-name (or (if (listp +license/license-choice) - (car +license/license-choice) - +license/license-choice) - "Unlicense"))) - (format "Copyright (C) %s %s - -You may distribute and modify this code under the terms of the %s + (let ((license-name (if (listp +license/license-choice) + (car +license/license-choice) + +license/license-choice))) + (concat + (format "Copyright (C) %s %s\n\n" (format-time-string "%Y") user-full-name) + (if license-name + (format "You may distribute and modify this code under the terms of the %s license. You should have received a copy of the %s license with this file. If not, please write to: %s." - (format-time-string "%Y") - user-full-name - license-name - license-name - user-mail-address))) + license-name + license-name + user-mail-address) + (format + "All rights reserved. You may not distribute or modify this code +without explicit legal permission from the author \"%s\"" + user-full-name))))) (defun +license/insert-complete-license () (interactive) -- cgit v1.2.3-13-gbd6f From 711dcf5e2d592271e0939c205ba33dbd93a4d547 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 24 Apr 2024 04:00:41 +0530 Subject: (Emacs/literate)~reworked literate to only compile if necessary Speeds up boot and kill. Actually checks for timestamps and logical errors are removed. --- Emacs/.config/emacs/elisp/literate.el | 144 +++++++++++++++++++++++----------- 1 file changed, 100 insertions(+), 44 deletions(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/literate.el b/Emacs/.config/emacs/elisp/literate.el index 114c3bb..077de93 100644 --- a/Emacs/.config/emacs/elisp/literate.el +++ b/Emacs/.config/emacs/elisp/literate.el @@ -24,6 +24,16 @@ ;;; Code: +;; Predicates +(defun +literate/org-to-el (name) + (string-replace ".org" ".el" name)) + +(defun +literate/org-to-elc (name) + (string-replace ".org" ".elc" name)) + +(defun +literate/el-to-elc (name) + (string-replace ".el" ".elc" name)) + (defun +literate/filter (predicate list) (if (null list) nil @@ -39,70 +49,116 @@ (defun +literate/el-p (filename) (string= "el" (file-name-extension filename))) +(defun +literate/--reduce-bool (bools init) + (if (= (length bools) 0) + init + (+literate/--reduce-bool (cdr bools) (and (car bools) init)))) + +;; Files (defconst +literate/org-files (+literate/filter #'+literate/org-p (mapcar #'(lambda (file) (concat user-emacs-directory file)) - (cddr (directory-files user-emacs-directory))))) + (cddr (directory-files user-emacs-directory))))) -(defconst +literate/output-files - (mapcar #'(lambda (x) (replace-regexp-in-string ".org" ".el" x)) +literate/org-files)) - -(defconst +literate/elisp-files +(defconst +literate/el-init-files `(,(concat user-emacs-directory "early-init.el") - ,(concat user-emacs-directory "init.el") - ,@+literate/output-files - ,@(mapcar - #'(lambda (name) (concat user-emacs-directory "elisp/" name)) - ;; Only take .el files - (+literate/filter - #'+literate/el-p - (cddr (directory-files (concat user-emacs-directory "elisp/"))))))) + ,(concat user-emacs-directory "init.el"))) -;; Setup predicates and loading +(defconst +literate/el-lib-files + (mapcar + #'(lambda (name) (concat user-emacs-directory "elisp/" name)) + ;; Only take .el files + (+literate/filter + #'+literate/el-p + (cddr (directory-files (concat user-emacs-directory "elisp/")))))) -(defun +literate/--reduce-bool (bools init) - (if (= (length bools) 0) - init - (+literate/--reduce-bool (cdr bools) (and (car bools) init)))) +(defconst +literate/el-org-files + (mapcar #'+literate/org-to-el +literate/org-files)) -(defun +literate/output-files-exist () - "Checks if output files exist, for compilation purposes." - (if (< 1 (length +literate/output-files)) - (+literate/--reduce-bool (mapcar #'file-exists-p +literate/output-files) t) - (file-exists-p (car +literate/output-files)))) +(defconst +literate/el-files + (cl-concatenate + 'list + +literate/el-init-files + +literate/el-lib-files + +literate/el-org-files)) -(defun +literate/load-config () - "Load the first file in +literate/output-files." - (interactive) - (load-file (concat user-emacs-directory "config.el"))) +(defconst +literate/elc-init-files + (mapcar #'+literate/el-to-elc +literate/el-init-files)) + +(defconst +literate/elc-lib-files + (mapcar #'+literate/el-to-elc +literate/el-lib-files)) +(defconst +literate/elc-org-files + (mapcar #'+literate/org-to-elc +literate/org-files)) + +;; Basic compilation and loading files (autoload #'org-babel-tangle-file "ob-tangle") (defun +literate/tangle-if-old (org-file) - (let ((output-file (replace-regexp-in-string ".org" ".el" org-file))) - (message "Tangle(%s)->%s" org-file output-file) - (if (or (not (file-exists-p output-file)) (file-newer-than-file-p org-file output-file)) - (org-babel-tangle-file org-file)))) + (let ((output-file (+literate/org-to-el org-file))) + (when (file-newer-than-file-p org-file output-file) + (message "[Literate]:\tTangle(%s)->%s" org-file output-file) + (org-babel-tangle-file org-file)))) (defun +literate/byte-compile-if-old (el-file) - (let ((output-file (replace-regexp-in-string ".el" ".elc" el-file))) - (if (file-newer-than-file-p el-file output-file) - (byte-compile-file el-file)))) + (let ((output-file (+literate/el-to-elc el-file))) + (when (file-newer-than-file-p el-file output-file) + (message "[Literate]:\tByteCompile(%s)->%s" el-file output-file) + (byte-compile-file el-file)))) + +(defun +literate/load-org-file (org-file) + (+literate/tangle-if-old org-file) + (load-file (+literate/org-to-el org-file))) + +(defun +literate/load-config () + "Load the config.el." + (interactive) + (mapcar #'+literate/tangle-if-old +literate/org-files) + (load-file (concat user-emacs-directory "config.el"))) + +;; Compiling all files +(defun +literate/compile-init-files () + (message "[Literate/init]: Byte compiling init files...") + (mapc #'+literate/byte-compile-if-old +literate/el-init-files) + (message "[Literate/init]: Init files compiled!")) + +(defun +literate/compile-lib-files () + (message "[Literate/lib]: Byte compiling lib files...") + (mapc #'+literate/byte-compile-if-old +literate/el-lib-files) + (message "[Literate/lib]: Lib files compiled!")) + +(defun +literate/compile-org-files () + (message "[Literate/org]: Tangling org files...") + (mapc #'+literate/tangle-if-old +literate/org-files) + (message "[Literate/org]: Tangled org files!") + (message "[Literate/org]: Byte compiling org files...") + (mapc #'+literate/byte-compile-if-old +literate/el-org-files) + (message "[Literate/org]: Byte compiled org files!")) (defun +literate/compile-config () "Compile all files in +literate/org-files via org-babel-tangle." (interactive) - (message "Compiling files...") - (mapc #'+literate/tangle-if-old +literate/org-files) - (message "Files compiled") - - (message "Byte-compiling literate files...") - (mapc #'+literate/byte-compile-if-old +literate/output-files) - (message "Literate files byte-compiled") - (message "Byte compiling init.el, early-init.el, *.org~>*.el elisp/*") - (mapc #'+literate/byte-compile-if-old +literate/elisp-files) - (message "Finished byte-compiling")) + (message "[Literate]: Starting compilation...") + (+literate/compile-init-files) + (+literate/compile-lib-files) + (+literate/compile-org-files) + (message "[Literate]: Finished compilation!")) + +;; Cleaning config +(defun +literate/clean-config () + "Removes all .el files generated by literate org files and .elc +files by byte compilation" + (interactive) + (message "[Literate]: Cleaning configuration...") + (mapcar #'delete-file + (cl-concatenate + 'list + +literate/el-org-files + +literate/elc-init-files + +literate/elc-lib-files + +literate/elc-org-files)) + (message "[Literate]: Cleaned configuration!")) (provide 'literate) ;;; literate.el ends here -- cgit v1.2.3-13-gbd6f From 870ce03d0279bc1ce7215c311b061d68c95fdbc1 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sat, 27 Apr 2024 14:42:15 +0530 Subject: (Emacs/config|core|elisp)+move.el Library to move words forward and backward as well as lines up and down. These movements keep the object in question under the cursor which provides a nice experience. --- Emacs/.config/emacs/elisp/move.el | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Emacs/.config/emacs/elisp/move.el (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/move.el b/Emacs/.config/emacs/elisp/move.el new file mode 100644 index 0000000..77dd785 --- /dev/null +++ b/Emacs/.config/emacs/elisp/move.el @@ -0,0 +1,85 @@ +;;; move-line.el --- Move current line up or down -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Aryadev Chavali + +;; Author: Aryadev Chavali +;; Keywords: + +;; This is free and unencumbered software released into the public domain. + +;; Anyone is free to copy, modify, publish, use, compile, sell, or +;; distribute this software, either in source code form or as a compiled +;; binary, for any purpose, commercial or non-commercial, and by any +;; means. + +;; In jurisdictions that recognize copyright laws, the author or authors +;; of this software dedicate any and all copyright interest in the +;; software to the public domain. We make this dedication for the benefit +;; of the public at large and to the detriment of our heirs and +;; successors. We intend this dedication to be an overt act of +;; relinquishment in perpetuity of all present and future rights to this +;; software under copyright law. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +;; IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +;; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +;; OTHER DEALINGS IN THE SOFTWARE. + +;; For more information, please refer to + +;;; Commentary: + +;; Move the current line up or down. Shamelessly copied from +;; https://emacsredux.com/blog/2013/04/02/move-current-line-up-or-down/ so + +;;; Code: + +(defun +move/--normalise-arg (arg) + (if (or (null arg) (< arg 1)) + 1 + arg)) + +(defmacro +move/create-move (name description &rest body) + `(defun ,name (&optional arg) + ,description + (interactive "P") + (let ((arg (+move/--normalise-arg arg))) + (while (not (= arg 0)) + ,@body + (setq arg (- arg 1)))))) + +(+move/create-move + +move/line-up + "Move the current line up" + (transpose-lines 1) + (forward-line -2) + (indent-according-to-mode)) + +(+move/create-move + +move/line-down + "Move the current line down" + (forward-line 1) + (transpose-lines 1) + (forward-line -1) + (indent-according-to-mode)) + +(+move/create-move + +move/word-forward + "Move the current word forward" + (forward-word 1) + (transpose-words 1) + (forward-word -1) + (indent-according-to-mode)) + +(+move/create-move + +move/word-backward + "Move the current word backward" + (transpose-words 1) + (forward-word -2) + (indent-according-to-mode)) + +(provide 'move) +;;; move.el ends here -- cgit v1.2.3-13-gbd6f From 04a4f50daf64f3159b9f8f15c0a106073d738a54 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 5 May 2024 23:24:38 +0530 Subject: (Emacs/elisp)+customised faces for tab-bar-mode --- Emacs/.config/emacs/elisp/personal-light-theme.el | 45 ++++++----- .../.config/emacs/elisp/personal-primary-theme.el | 93 ++++++++++++---------- 2 files changed, 76 insertions(+), 62 deletions(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/personal-light-theme.el b/Emacs/.config/emacs/elisp/personal-light-theme.el index 5486b5c..94a0a18 100644 --- a/Emacs/.config/emacs/elisp/personal-light-theme.el +++ b/Emacs/.config/emacs/elisp/personal-light-theme.el @@ -3,18 +3,10 @@ (custom-theme-set-faces 'personal-light - '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :height 143 :weight normal :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "black" :background "white" :stipple nil :inherit nil)))) + '(button ((t (:inherit (link))))) '(cursor ((((background light)) (:background "black")) (((background dark)) (:background "white")))) - '(fixed-pitch ((t (:family "Monospace")))) - '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif")))) '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) - '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) - '(minibuffer-prompt ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "medium blue")))) - '(highlight ((((class color) (min-colors 88) (background light)) (:background "darkseagreen2")) (((class color) (min-colors 88) (background dark)) (:background "darkolivegreen")) (((class color) (min-colors 16) (background light)) (:background "darkseagreen2")) (((class color) (min-colors 16) (background dark)) (:background "darkolivegreen")) (((class color) (min-colors 8)) (:foreground "black" :background "green")) (t (:inverse-video t)))) - '(region ((t (:extend t :background "green yellow" :distant-foreground "gtk_selection_fg_color")))) - '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow")))) - '(secondary-selection ((((class color) (min-colors 88) (background light)) (:extend t :background "yellow1")) (((class color) (min-colors 88) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:extend t :background "yellow")) (((class color) (min-colors 16) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 8)) (:extend t :foreground "black" :background "cyan")) (t (:inverse-video t)))) - '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t)))) + '(fixed-pitch ((t (:family "Monospace")))) '(font-lock-builtin-face ((((class grayscale) (background light)) (:weight bold :foreground "LightGray")) (((class grayscale) (background dark)) (:weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "dark slate blue")) (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 16) (background light)) (:foreground "Orchid")) (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 8)) (:weight bold :foreground "blue")) (t (:weight bold)))) '(font-lock-comment-delimiter-face ((t (:inherit (font-lock-comment-face))))) '(font-lock-comment-face ((t (:foreground "dim gray")))) @@ -31,26 +23,37 @@ '(font-lock-type-face ((((class grayscale) (background light)) (:weight bold :foreground "Gray90")) (((class grayscale) (background dark)) (:weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "ForestGreen")) (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen")) (((class color) (min-colors 16) (background light)) (:foreground "ForestGreen")) (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen")) (((class color) (min-colors 8)) (:foreground "green")) (t (:underline (:color foreground-color :style line) :weight bold)))) '(font-lock-variable-name-face ((((class grayscale) (background light)) (:slant italic :weight bold :foreground "Gray90")) (((class grayscale) (background dark)) (:slant italic :weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "sienna")) (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod")) (((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod")) (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod")) (((class color) (min-colors 8)) (:weight light :foreground "yellow")) (t (:slant italic :weight bold)))) '(font-lock-warning-face ((t (:inherit (error))))) - '(button ((t (:inherit (link))))) - '(link ((t (:underline (:color foreground-color :style line) :foreground "RoyalBlue3")))) - '(link-visited ((t (:foreground "magenta4" :inherit (link))))) '(fringe ((((class color) (background light)) (:background "grey95")) (((class color) (background dark)) (:background "grey10")) (t (:background "gray")))) '(header-line ((t (:box nil :foreground "grey20" :background "grey90" :inherit (mode-line))))) - '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch))))) - '(mode-line ((t (:box (:line-width (1 . -1) :color nil :style released-button) :foreground "black" :background "grey75")))) - '(mode-line-buffer-id ((t (:weight bold)))) - '(mode-line-emphasis ((t (:weight bold)))) - '(mode-line-highlight ((t (:box (:line-width (2 . 2) :color "grey40" :style released-button))))) - '(mode-line-inactive ((t (:weight light :box (:line-width (1 . -1) :color "grey75" :style nil) :foreground "grey20" :background "grey90" :inherit (mode-line))))) + '(highlight ((t (:background "gainsboro")))) + '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) '(isearch ((((class color) (min-colors 88) (background light)) (:foreground "lightskyblue1" :background "magenta3")) (((class color) (min-colors 88) (background dark)) (:foreground "brown4" :background "palevioletred2")) (((class color) (min-colors 16)) (:foreground "cyan1" :background "magenta4")) (((class color) (min-colors 8)) (:foreground "cyan1" :background "magenta4")) (t (:inverse-video t)))) '(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t)))) '(lazy-highlight ((((class color) (min-colors 88) (background light)) (:background "paleturquoise")) (((class color) (min-colors 88) (background dark)) (:background "paleturquoise4")) (((class color) (min-colors 16)) (:background "turquoise3")) (((class color) (min-colors 8)) (:background "turquoise3")) (t (:underline (:color foreground-color :style line))))) + '(link ((t (:underline (:color foreground-color :style line) :foreground "RoyalBlue3")))) + '(link-visited ((t (:foreground "magenta4" :inherit (link))))) '(match ((((class color) (min-colors 88) (background light)) (:background "khaki1")) (((class color) (min-colors 88) (background dark)) (:background "RoyalBlue3")) (((class color) (min-colors 8) (background light)) (:foreground "black" :background "yellow")) (((class color) (min-colors 8) (background dark)) (:foreground "white" :background "blue")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "gray")))) + '(minibuffer-prompt ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "medium blue")))) + '(mode-line ((t (:box nil :background "LightSkyBlue" :foreground "black")))) + '(mode-line-buffer-id ((t (:weight bold)))) + '(mode-line-emphasis ((t (:weight bold)))) + '(mode-line-highlight ((t (:box (:line-width (2 . 2) :color "grey40" :style released-button))))) + '(mode-line-inactive ((t (:foreground "grey20" :background "grey90" :inherit (mode-line))))) '(next-error ((t (:inherit (region))))) - '(query-replace ((t (:inherit (isearch))))) '(org-block ((t (:background "white" :inherit shadow)))) - '(whitespace-space ((t (:background "white" :foreground "lightgray")))) + '(query-replace ((t (:inherit (isearch))))) + '(region ((t (:extend t :background "green yellow" :distant-foreground "gtk_selection_fg_color")))) + '(secondary-selection ((((class color) (min-colors 88) (background light)) (:extend t :background "yellow1")) (((class color) (min-colors 88) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:extend t :background "yellow")) (((class color) (min-colors 16) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 8)) (:extend t :foreground "black" :background "cyan")) (t (:inverse-video t)))) + '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow")))) + '(tab-bar ((t (:background "white")))) + '(tab-bar-tab ((t (:foreground "gray30" :background "white")))) + '(tab-bar-tab-inactive ((t (:foreground "gray13" :background "gray80")))) + '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch))))) + '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t)))) + '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif")))) '(whitespace-line ((t (:background "white" :foreground "violet")))) + '(whitespace-space ((t (:background "white" :foreground "lightgray")))) + '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :height 143 :weight normal :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "black" :background "white" :stipple nil :inherit nil)))) ) (provide-theme 'personal-light) diff --git a/Emacs/.config/emacs/elisp/personal-primary-theme.el b/Emacs/.config/emacs/elisp/personal-primary-theme.el index 747b483..8f65078 100644 --- a/Emacs/.config/emacs/elisp/personal-primary-theme.el +++ b/Emacs/.config/emacs/elisp/personal-primary-theme.el @@ -3,26 +3,30 @@ (custom-theme-set-faces 'personal-primary - '(line-number ((t (:foreground "gray45" :background "gray1" :inherit (default))))) - '(line-number-current-line ((t (:foreground "white" :background "gray1" :inherit (default))))) + '(button ((t (:inherit (link))))) + '(tab-bar ((t (:background "gray13")))) + '(tab-bar-tab ((t (:background "gray20" :foreground "white" :box (:color ))))) + '(tab-bar-tab-inactive ((t (:background "gray13" :foreground "DimGrey")))) '(child-frame-border ((t (:background "white")))) - '(cursor ((((background light)) (:background "black")) (((background dark)) (:background "white")))) + '(company-preview + ((t (:foreground "wheat" :background "blue4")))) + '(company-preview-common ((t (:inherit company-preview :foreground "grey")))) + '(company-tooltip ((t (:background "black" :foreground "white")))) + '(company-tooltip-annotation ((t (:foreground "grey" :slant italic)))) + '(company-tooltip-selection ((t (:background "gray31" :slant italic)))) + '(cursor ((t (:background "white")))) + '(dired-ignored ((t (:background "gray10")))) + '(escape-glyph ((t (:foreground "cyan")))) + '(eshell-ls-directory ((t (:foreground "DeepSkyBlue3" :weight bold)))) + '(eshell-prompt ((t (:foreground "turquoise3" :weight bold)))) '(fixed-pitch ((t (:family "Monospace")))) - '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif")))) - '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) - '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) - '(minibuffer-prompt ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "medium blue")))) - '(highlight ((t (:background "gray14")))) - '(region ((t (:extend t :background "gray25")))) - '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow")))) - '(secondary-selection ((((class color) (min-colors 88) (background light)) (:extend t :background "yellow1")) (((class color) (min-colors 88) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:extend t :background "yellow")) (((class color) (min-colors 16) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 8)) (:extend t :foreground "black" :background "cyan")) (t (:inverse-video t)))) - '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")))) ;;(t (:inverse-video t)))) '(font-lock-builtin-face ((t (:foreground "powder blue")))) '(font-lock-comment-delimiter-face ((t (:slant italic :foreground "gray24")))) '(font-lock-comment-face ((t (:slant italic :foreground "#868686")))) '(font-lock-constant-face ((t (:foreground "indian red" :weight semi-bold :height 0.99 :family "Source Code Pro")))) '(font-lock-doc-face ((t (:inherit (font-lock-string-face))))) - '(font-lock-function-name-face ((t (:weight semi-bold)))) + '(font-lock-function-name-face ((t (:weight semi-bold :foreground "#b6b6b6")))) + '(font-lock-function-call-face ((t (:weight semi-bold :foreground "#b6b6b6")))) '(font-lock-keyword-face ((t (:foreground "spring green" :weight bold :height 0.95 :family "Fira Code")))) '(font-lock-negation-char-face ((t nil))) '(font-lock-preprocessor-face ((t (:family "Source Code Pro" :foreground "#868686")))) @@ -32,44 +36,51 @@ '(font-lock-type-face ((t (:weight light :foreground "deepskyblue" :family "DejaVu Sans Mono")))) '(font-lock-variable-name-face ((nil (:family "Source Code Pro" :foreground "white")))) '(font-lock-warning-face ((t (:inherit (error))))) - '(button ((t (:inherit (link))))) - '(link ((t (:underline (:color foreground-color :style line) :foreground "cyan1")))) - '(link-visited ((t (:foreground "violet" :inherit (link))))) '(fringe ((t (:background "grey4")))) + '(haskell-interactive-face-prompt ((t (:foreground "green")))) '(header-line ((t (:box nil :foreground "grey90" :background "grey20" :inherit (mode-line))))) - '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch))))) + '(highlight ((t (:background "gray14")))) + '(homoglyph ((t (:foreground "cyan")))) + '(isearch ((t (:foreground "brown4" :background "white")))) + '(isearch-fail ((t (:background "red4")))) + '(ivy-current-match ((t (:weight bold :underline t :slant italic)))) + '(lazy-highlight ((t (:background "paleturquoise4")))) + '(line-number ((t (:foreground "gray45" :background "gray1" :inherit (default))))) + '(line-number-current-line ((t (:foreground "white" :background "gray1" :inherit (default))))) + '(link ((t (:underline (:color foreground-color :style line) :foreground "cyan1")))) + '(link-visited ((t (:foreground "violet" :inherit (link))))) + '(match ((t (:background "RoyalBlue3")))) + '(minibuffer-prompt ((t (:foreground "cyan")))) '(mode-line ((t (:box nil :foreground "LightSkyBlue" :background "black")))) '(mode-line-buffer-id ((t (:weight bold)))) '(mode-line-emphasis ((t (:weight bold)))) - '(mode-line-highlight ((((class color) (min-colors 88)) (:box (:line-width 2 :color "grey40" :style released-button))) (t (:inherit (highlight))))) - '(mode-line-inactive ((t (:weight light :foreground "CadetBlue" :background "grey7" :inherit (mode-line))))) - '(isearch ((t (:foreground "brown4" :background "white")))) - '(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t)))) - '(lazy-highlight ((((class color) (min-colors 88) (background light)) (:background "paleturquoise")) (((class color) (min-colors 88) (background dark)) (:background "paleturquoise4")) (((class color) (min-colors 16)) (:background "turquoise3")) (((class color) (min-colors 8)) (:background "turquoise3")) (t (:underline (:color foreground-color :style line))))) - '(match ((((class color) (min-colors 88) (background light)) (:background "yellow1")) (((class color) (min-colors 88) (background dark)) (:background "RoyalBlue3")) (((class color) (min-colors 8) (background light)) (:foreground "black" :background "yellow")) (((class color) (min-colors 8) (background dark)) (:foreground "white" :background "blue")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "gray")))) + '(mode-line-inactive ((t (:weight light :foreground "CadetBlue" :background "grey7" + :inherit (mode-line))))) '(next-error ((t (:inherit (region))))) - '(query-replace ((t (:inherit (isearch))))) - '(company-tooltip ((t (:background "black" :foreground "white")))) - '(company-tooltip-selection ((t (:background "gray31" :slant italic)))) - '(company-tooltip-annotation ((t (:foreground "grey" :slant italic)))) - '(company-preview ((((background light)) (:inherit (company-tooltip-selection company-tooltip))) (((background dark)) (:foreground "wheat" :background "blue4")))) - '(company-preview-common ((t (:inherit company-preview :foreground "grey")))) - '(org-block ((t (:background "gray3" :inherit shadow)))) - '(org-quote ((t (:slant italic)))) - '(eshell-prompt ((t (:foreground "turquoise3" :weight bold)))) - '(eshell-ls-directory ((t (:foreground "DeepSkyBlue3" :weight bold)))) - '(whitespace-tab ((t (:background "gray5" :foreground "gray20")))) - '(whitespace-space ((t (:background "gray2" :foreground "darkgray")))) - '(whitespace-line ((t (:background "black" :foreground "violet")))) - '(haskell-interactive-face-prompt ((t (:foreground "green")))) - '(org-verbatim ((t (:foreground "red3")))) - '(org-code ((t (:foreground "green3")))) - '(ivy-current-match ((t (:weight bold :underline t :slant italic)))) '(orderless-match-face-0 ((t (:weight bold :foreground "lime green")))) '(orderless-match-face-1 ((t (:weight bold :foreground "light green")))) '(orderless-match-face-2 ((t (:weight bold :foreground "forest green")))) '(orderless-match-face-3 ((t (:weight bold :foreground "dark green")))) + '(org-block ((t (:background "gray3" :inherit shadow)))) + '(org-code ((t (:foreground "green3")))) + '(org-quote ((t (:slant italic)))) + '(org-verbatim ((t (:foreground "red3")))) '(pdf-isearch-batch ((t (:foreground "black" :background "white")))) - '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :weight normal :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "#b6b6b6" :background "gray5" :stipple nil :inherit nil))))) + '(query-replace ((t (:inherit (isearch))))) + '(region ((t (:extend t :background "gray25")))) + '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow")))) + '(secondary-selection + ((t (:extend t :background "SkyBlue4")))) + '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch))))) + '(trailing-whitespace ((((class color) (background light)) (:background "red1")) + (((class color) (background dark)) (:background "red1")))) + '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif")))) + '(whitespace-line ((t (:background "black" :foreground "violet")))) + '(whitespace-space ((t (:background "gray2" :foreground "darkgray")))) + '(whitespace-tab ((t (:background "gray5" :foreground "gray20")))) + '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal + :weight normal :slant normal :underline nil :overline nil + :extend nil :strike-through nil :box nil :inverse-video nil :foreground "#b6b6b6" + :background "black" :stipple nil :inherit nil))))) (provide-theme 'personal-primary) -- cgit v1.2.3-13-gbd6f From 2986c04c2fcad44eb80ce01336ade33a7429cf7a Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 6 May 2024 02:23:38 +0530 Subject: (Emacs|Shell|SystemD)~Small changes --- Emacs/.config/emacs/elisp/haskell-multiedit.el | 5 ++--- Emacs/.config/emacs/elisp/move.el | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/haskell-multiedit.el b/Emacs/.config/emacs/elisp/haskell-multiedit.el index 89aeb7b..96eb19d 100644 --- a/Emacs/.config/emacs/elisp/haskell-multiedit.el +++ b/Emacs/.config/emacs/elisp/haskell-multiedit.el @@ -37,9 +37,8 @@ "Minor mode for haskell buffers generated by haskell-interactive-mode. Provides bindings to retrieve content back into the REPL with full multi-edit commands" - nil - "" - haskell-multiedit-mode-map) + :lighter nil + :keymap haskell-multiedit-mode-map) (with-eval-after-load "haskell" (defun haskell-multiedit () diff --git a/Emacs/.config/emacs/elisp/move.el b/Emacs/.config/emacs/elisp/move.el index 77dd785..ed154fb 100644 --- a/Emacs/.config/emacs/elisp/move.el +++ b/Emacs/.config/emacs/elisp/move.el @@ -37,16 +37,11 @@ ;;; Code: -(defun +move/--normalise-arg (arg) - (if (or (null arg) (< arg 1)) - 1 - arg)) - (defmacro +move/create-move (name description &rest body) `(defun ,name (&optional arg) ,description (interactive "P") - (let ((arg (+move/--normalise-arg arg))) + (let ((arg (if (or (null arg) (< arg 1)) 1 arg))) (while (not (= arg 0)) ,@body (setq arg (- arg 1)))))) -- cgit v1.2.3-13-gbd6f From 14f29b83197b72ad0d99b646bb18f0c2f01f6709 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 6 May 2024 02:36:27 +0530 Subject: (Emacs/elisp)+italic and underline to dired-ignore face in primary-theme --- Emacs/.config/emacs/elisp/personal-primary-theme.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/personal-primary-theme.el b/Emacs/.config/emacs/elisp/personal-primary-theme.el index 8f65078..6411f08 100644 --- a/Emacs/.config/emacs/elisp/personal-primary-theme.el +++ b/Emacs/.config/emacs/elisp/personal-primary-theme.el @@ -15,7 +15,7 @@ '(company-tooltip-annotation ((t (:foreground "grey" :slant italic)))) '(company-tooltip-selection ((t (:background "gray31" :slant italic)))) '(cursor ((t (:background "white")))) - '(dired-ignored ((t (:background "gray10")))) + '(dired-ignored ((t (:background "gray10" :slant italic :underline t)))) '(escape-glyph ((t (:foreground "cyan")))) '(eshell-ls-directory ((t (:foreground "DeepSkyBlue3" :weight bold)))) '(eshell-prompt ((t (:foreground "turquoise3" :weight bold)))) -- cgit v1.2.3-13-gbd6f From 89cc78f476ada3f3cf1f125c5c9b4e9b3e215d59 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 7 May 2024 00:14:32 +0530 Subject: (Emacs/elisp)+bytecompile? option to literate So if you don't want to, say while debugging, it won't. --- Emacs/.config/emacs/elisp/literate.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/literate.el b/Emacs/.config/emacs/elisp/literate.el index 077de93..ffd4963 100644 --- a/Emacs/.config/emacs/elisp/literate.el +++ b/Emacs/.config/emacs/elisp/literate.el @@ -92,6 +92,9 @@ (defconst +literate/elc-org-files (mapcar #'+literate/org-to-elc +literate/org-files)) +(defvar +literate/bytecompile? t + "Bytecompile all files?") + ;; Basic compilation and loading files (autoload #'org-babel-tangle-file "ob-tangle") @@ -119,22 +122,25 @@ ;; Compiling all files (defun +literate/compile-init-files () - (message "[Literate/init]: Byte compiling init files...") - (mapc #'+literate/byte-compile-if-old +literate/el-init-files) + (when +literate/bytecompile? + (message "[Literate/init]: Byte compiling init files...") + (mapc #'+literate/byte-compile-if-old +literate/el-init-files)) (message "[Literate/init]: Init files compiled!")) (defun +literate/compile-lib-files () - (message "[Literate/lib]: Byte compiling lib files...") - (mapc #'+literate/byte-compile-if-old +literate/el-lib-files) + (when +literate/bytecompile? + (message "[Literate/lib]: Byte compiling lib files...") + (mapc #'+literate/byte-compile-if-old +literate/el-lib-files)) (message "[Literate/lib]: Lib files compiled!")) (defun +literate/compile-org-files () (message "[Literate/org]: Tangling org files...") (mapc #'+literate/tangle-if-old +literate/org-files) (message "[Literate/org]: Tangled org files!") - (message "[Literate/org]: Byte compiling org files...") - (mapc #'+literate/byte-compile-if-old +literate/el-org-files) - (message "[Literate/org]: Byte compiled org files!")) + (when +literate/bytecompile? + (message "[Literate/org]: Byte compiling org files...") + (mapc #'+literate/byte-compile-if-old +literate/el-org-files) + (message "[Literate/org]: Byte compiled org files!"))) (defun +literate/compile-config () "Compile all files in +literate/org-files via org-babel-tangle." -- cgit v1.2.3-13-gbd6f From 6aa3c170e93ea9a88b16816a3396778def524a01 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sat, 11 May 2024 13:05:41 +0530 Subject: (Emacs/*)~clean up text, change license of elisp packages to GPLv2 strictly --- Emacs/.config/emacs/elisp/ada-mode.el | 7 +++---- Emacs/.config/emacs/elisp/haskell-multiedit.el | 7 +++---- Emacs/.config/emacs/elisp/hide-mode-line.el | 15 ++++++--------- Emacs/.config/emacs/elisp/license.el | 9 +++------ Emacs/.config/emacs/elisp/literate.el | 7 +++---- 5 files changed, 18 insertions(+), 27 deletions(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/ada-mode.el b/Emacs/.config/emacs/elisp/ada-mode.el index a789fc2..1d83da9 100644 --- a/Emacs/.config/emacs/elisp/ada-mode.el +++ b/Emacs/.config/emacs/elisp/ada-mode.el @@ -5,10 +5,9 @@ ;; Author: Aryadev Chavali ;; Keywords: faces, 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 free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License Version +;; 2 as published by the Free Software Foundation. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/Emacs/.config/emacs/elisp/haskell-multiedit.el b/Emacs/.config/emacs/elisp/haskell-multiedit.el index 96eb19d..81a5338 100644 --- a/Emacs/.config/emacs/elisp/haskell-multiedit.el +++ b/Emacs/.config/emacs/elisp/haskell-multiedit.el @@ -7,10 +7,9 @@ ;; Author: Aryadev Chavali ;; Keywords: -;; 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 free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License version +;; 2 as published by the Free Software Foundation. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/Emacs/.config/emacs/elisp/hide-mode-line.el b/Emacs/.config/emacs/elisp/hide-mode-line.el index a16667d..488bf3f 100644 --- a/Emacs/.config/emacs/elisp/hide-mode-line.el +++ b/Emacs/.config/emacs/elisp/hide-mode-line.el @@ -5,10 +5,9 @@ ;; Author: Aryadev Chavali ;; Keywords: -;; 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 free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License version +;; 2 as published by the Free Software Foundation. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -31,11 +30,9 @@ "Hides the mode line." :lighter nil (if mode-line-format - (progn - (setq-local hide-mode-line--prev-mode-line mode-line-format) - (setq-local mode-line-format nil)) - (setq-local mode-line-format hide-mode-line--prev-mode-line))) - + (setq-local hide-mode-line--prev-mode-line mode-line-format + mode-line-format nil) + (setq-local mode-line-format hide-mode-line--prev-mode-line))) (provide 'hide-mode-line) ;;; hide-mode-line.el ends here diff --git a/Emacs/.config/emacs/elisp/license.el b/Emacs/.config/emacs/elisp/license.el index 5921d59..a4922ab 100644 --- a/Emacs/.config/emacs/elisp/license.el +++ b/Emacs/.config/emacs/elisp/license.el @@ -5,10 +5,9 @@ ;; Author: Aryadev Chavali ;; Keywords: -;; 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 free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License version +;; 2 as published by the Free Software Foundation. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,9 +18,7 @@ ;; along with this program. If not, see . ;;; Commentary: - ;; - ;;; Code: (defvar +license/license-choice nil) diff --git a/Emacs/.config/emacs/elisp/literate.el b/Emacs/.config/emacs/elisp/literate.el index ffd4963..5039446 100644 --- a/Emacs/.config/emacs/elisp/literate.el +++ b/Emacs/.config/emacs/elisp/literate.el @@ -5,10 +5,9 @@ ;; Author: Aryadev Chavali ;; Keywords: -;; 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 free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License version +;; 2 as published by the Free Software Foundation. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit v1.2.3-13-gbd6f From 5fee49b69d6605d3d695f2df56f2139c0b6ef11b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 12 May 2024 21:12:32 +0530 Subject: (Emacs/elisp)+search.el I can now completing-read search git files from a ton of repositories AND grep them. --- Emacs/.config/emacs/elisp/search.el | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Emacs/.config/emacs/elisp/search.el (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/search.el b/Emacs/.config/emacs/elisp/search.el new file mode 100644 index 0000000..8988572 --- /dev/null +++ b/Emacs/.config/emacs/elisp/search.el @@ -0,0 +1,67 @@ +;;; search.el --- Search a list of git directories at once! -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Aryadev Chavali + +;; Author: Aryadev Chavali +;; Keywords: + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License Version +;; 2 as published by the Free Software Foundation. + +;; 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: + +;; Given a list of git source directories, provide a completing-read +;; interface which will narrow and give you a file. + +;;; Code: + +(defvar +search/directories + '("~/Dotfiles/" "~/Text/" "~/.local/src/dwm/" "~/.local/src/dwmblocks/" "~/.local/src/st/") + "List of directories to get candidates from.") + +(defun +search/get-candidates (directory) + "Get files from DIRECTORY using counsel-git-cands. +Returns a list of files with the directory preprended to them." + (let* ((default-directory directory) + (names (split-string + (shell-command-to-string "git ls-files -z --full-name --") + "\0"))) + (mapcar #'(lambda (name) + (concat directory name)) + names))) + +(defun +search/get-all-candidates () + (cl-reduce + #'(lambda (x y) (append x y)) + (mapcar #'(lambda (directory) + (+search/get-candidates (expand-file-name directory))) + +search/directories))) + +(defun +search/find-file () + (interactive) + (find-file + (completing-read "Find file: " + (+search/get-all-candidates) + nil + t))) + +(defun +search/search-all () + (interactive) + (let ((term (read-string "Search for: "))) + (grep (format "grep --color=auto -nH --null -e \"%s\" -- %s" + term + (cl-reduce #'(lambda (x y) (concat x " " y)) + (mapcar #'(lambda (x) (concat "\"" x "\"")) + (cl-remove-if #'directory-name-p (+search/get-all-candidates)))))))) + +(provide 'search) +;;; search.el ends here -- cgit v1.2.3-13-gbd6f From 8fcdfac6614e1ea84f2bfd100b5713ce7dce2db0 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 13 May 2024 16:58:28 +0530 Subject: (Emacs)~Merged app.org, lang.org and core.org back into config.org Just makes it easier to profile and deal with compilation --- Emacs/.config/emacs/elisp/literate.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/literate.el b/Emacs/.config/emacs/elisp/literate.el index 5039446..43c39d8 100644 --- a/Emacs/.config/emacs/elisp/literate.el +++ b/Emacs/.config/emacs/elisp/literate.el @@ -55,10 +55,8 @@ ;; Files (defconst +literate/org-files - (+literate/filter - #'+literate/org-p - (mapcar #'(lambda (file) (concat user-emacs-directory file)) - (cddr (directory-files user-emacs-directory))))) + (mapcar #'(lambda (x) (expand-file-name (concat user-emacs-directory x))) + (list "config.org"))) (defconst +literate/el-init-files `(,(concat user-emacs-directory "early-init.el") -- cgit v1.2.3-13-gbd6f From ef5ac4371aff99a11e6dfaf016d201707918ff43 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 13 May 2024 17:03:27 +0530 Subject: (Emacs/elisp)~updated themes a bit --- Emacs/.config/emacs/elisp/personal-light-theme.el | 11 +++++-- .../.config/emacs/elisp/personal-primary-theme.el | 35 ++++++++++++---------- 2 files changed, 28 insertions(+), 18 deletions(-) (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/personal-light-theme.el b/Emacs/.config/emacs/elisp/personal-light-theme.el index 94a0a18..3747f05 100644 --- a/Emacs/.config/emacs/elisp/personal-light-theme.el +++ b/Emacs/.config/emacs/elisp/personal-light-theme.el @@ -4,7 +4,14 @@ (custom-theme-set-faces 'personal-light '(button ((t (:inherit (link))))) - '(cursor ((((background light)) (:background "black")) (((background dark)) (:background "white")))) + '(company-preview + ((t (:foreground "black" :background "deepskyblue")))) + '(company-preview-common ((t (:inherit company-preview)))) + '(company-tooltip ((t (:background "white" :foreground "black")))) + '(company-tooltip-annotation ((t (:foreground "grey70" :slant italic)))) + '(company-tooltip-selection ((t (:background "grey80" :slant italic)))) + '(cursor ((t (:background "grey50")))) + '(dired-ignored ((t (:background "grey80" :slant italic :underline t)))) '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) '(fixed-pitch ((t (:family "Monospace")))) '(font-lock-builtin-face ((((class grayscale) (background light)) (:weight bold :foreground "LightGray")) (((class grayscale) (background dark)) (:weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "dark slate blue")) (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 16) (background light)) (:foreground "Orchid")) (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 8)) (:weight bold :foreground "blue")) (t (:weight bold)))) @@ -25,7 +32,7 @@ '(font-lock-warning-face ((t (:inherit (error))))) '(fringe ((((class color) (background light)) (:background "grey95")) (((class color) (background dark)) (:background "grey10")) (t (:background "gray")))) '(header-line ((t (:box nil :foreground "grey20" :background "grey90" :inherit (mode-line))))) - '(highlight ((t (:background "gainsboro")))) + '(highlight ((t (:background "grey90")))) '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) '(isearch ((((class color) (min-colors 88) (background light)) (:foreground "lightskyblue1" :background "magenta3")) (((class color) (min-colors 88) (background dark)) (:foreground "brown4" :background "palevioletred2")) (((class color) (min-colors 16)) (:foreground "cyan1" :background "magenta4")) (((class color) (min-colors 8)) (:foreground "cyan1" :background "magenta4")) (t (:inverse-video t)))) '(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t)))) diff --git a/Emacs/.config/emacs/elisp/personal-primary-theme.el b/Emacs/.config/emacs/elisp/personal-primary-theme.el index 6411f08..07ef4fa 100644 --- a/Emacs/.config/emacs/elisp/personal-primary-theme.el +++ b/Emacs/.config/emacs/elisp/personal-primary-theme.el @@ -4,24 +4,24 @@ (custom-theme-set-faces 'personal-primary '(button ((t (:inherit (link))))) - '(tab-bar ((t (:background "gray13")))) - '(tab-bar-tab ((t (:background "gray20" :foreground "white" :box (:color ))))) - '(tab-bar-tab-inactive ((t (:background "gray13" :foreground "DimGrey")))) + '(tab-bar ((t (:background "grey13")))) + '(tab-bar-tab ((t (:background "grey20" :foreground "white" :box (:color ))))) + '(tab-bar-tab-inactive ((t (:background "grey13" :foreground "DimGrey")))) '(child-frame-border ((t (:background "white")))) '(company-preview ((t (:foreground "wheat" :background "blue4")))) '(company-preview-common ((t (:inherit company-preview :foreground "grey")))) '(company-tooltip ((t (:background "black" :foreground "white")))) '(company-tooltip-annotation ((t (:foreground "grey" :slant italic)))) - '(company-tooltip-selection ((t (:background "gray31" :slant italic)))) + '(company-tooltip-selection ((t (:background "grey31" :slant italic)))) '(cursor ((t (:background "white")))) - '(dired-ignored ((t (:background "gray10" :slant italic :underline t)))) + '(dired-ignored ((t (:background "grey10" :slant italic :underline t)))) '(escape-glyph ((t (:foreground "cyan")))) '(eshell-ls-directory ((t (:foreground "DeepSkyBlue3" :weight bold)))) '(eshell-prompt ((t (:foreground "turquoise3" :weight bold)))) '(fixed-pitch ((t (:family "Monospace")))) '(font-lock-builtin-face ((t (:foreground "powder blue")))) - '(font-lock-comment-delimiter-face ((t (:slant italic :foreground "gray24")))) + '(font-lock-comment-delimiter-face ((t (:slant italic :foreground "grey24")))) '(font-lock-comment-face ((t (:slant italic :foreground "#868686")))) '(font-lock-constant-face ((t (:foreground "indian red" :weight semi-bold :height 0.99 :family "Source Code Pro")))) '(font-lock-doc-face ((t (:inherit (font-lock-string-face))))) @@ -39,14 +39,14 @@ '(fringe ((t (:background "grey4")))) '(haskell-interactive-face-prompt ((t (:foreground "green")))) '(header-line ((t (:box nil :foreground "grey90" :background "grey20" :inherit (mode-line))))) - '(highlight ((t (:background "gray14")))) + '(highlight ((t (:extend t :background "#222233")))) '(homoglyph ((t (:foreground "cyan")))) '(isearch ((t (:foreground "brown4" :background "white")))) '(isearch-fail ((t (:background "red4")))) '(ivy-current-match ((t (:weight bold :underline t :slant italic)))) '(lazy-highlight ((t (:background "paleturquoise4")))) - '(line-number ((t (:foreground "gray45" :background "gray1" :inherit (default))))) - '(line-number-current-line ((t (:foreground "white" :background "gray1" :inherit (default))))) + '(line-number ((t (:foreground "grey45" :background "grey1" :inherit (default))))) + '(line-number-current-line ((t (:foreground "white" :background "grey1" :inherit (default))))) '(link ((t (:underline (:color foreground-color :style line) :foreground "cyan1")))) '(link-visited ((t (:foreground "violet" :inherit (link))))) '(match ((t (:background "RoyalBlue3")))) @@ -61,14 +61,17 @@ '(orderless-match-face-1 ((t (:weight bold :foreground "light green")))) '(orderless-match-face-2 ((t (:weight bold :foreground "forest green")))) '(orderless-match-face-3 ((t (:weight bold :foreground "dark green")))) - '(org-block ((t (:background "gray3" :inherit shadow)))) + '(org-block ((t (:background "grey3" :inherit shadow)))) '(org-code ((t (:foreground "green3")))) '(org-quote ((t (:slant italic)))) '(org-verbatim ((t (:foreground "red3")))) '(pdf-isearch-batch ((t (:foreground "black" :background "white")))) '(query-replace ((t (:inherit (isearch))))) - '(region ((t (:extend t :background "gray25")))) - '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow")))) + '(region ((t (:extend t :background "grey25")))) + '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) + (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) + (((class color) (min-colors 8) (background light)) (:foreground "green")) + (((class color) (min-colors 8) (background dark)) (:foreground "yellow")))) '(secondary-selection ((t (:extend t :background "SkyBlue4")))) '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch))))) @@ -76,11 +79,11 @@ (((class color) (background dark)) (:background "red1")))) '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif")))) '(whitespace-line ((t (:background "black" :foreground "violet")))) - '(whitespace-space ((t (:background "gray2" :foreground "darkgray")))) - '(whitespace-tab ((t (:background "gray5" :foreground "gray20")))) + '(whitespace-space ((t (:background "grey6" :foreground "black")))) + '(whitespace-tab ((t (:background "grey5" :foreground "grey20")))) '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :weight normal :slant normal :underline nil :overline nil - :extend nil :strike-through nil :box nil :inverse-video nil :foreground "#b6b6b6" - :background "black" :stipple nil :inherit nil))))) + :extend nil :strike-through nil :box nil :inverse-video nil + :foreground "#b6b6b6" :background "black" :stipple nil :inherit nil))))) (provide-theme 'personal-primary) -- cgit v1.2.3-13-gbd6f From ab2742cd3efa28fe3a9c8c58ebabae3e0bac31ae Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 13 May 2024 17:32:38 +0530 Subject: (Emacs/elisp|config)+org-bookmark manager Opens bookmarks from ~/Text/bookmarks.org with a dispatcher. --- Emacs/.config/emacs/elisp/org-bookmark.el | 77 +++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Emacs/.config/emacs/elisp/org-bookmark.el (limited to 'Emacs/.config/emacs/elisp') diff --git a/Emacs/.config/emacs/elisp/org-bookmark.el b/Emacs/.config/emacs/elisp/org-bookmark.el new file mode 100644 index 0000000..6bbad5d --- /dev/null +++ b/Emacs/.config/emacs/elisp/org-bookmark.el @@ -0,0 +1,77 @@ +;;; org-bookmark.el --- Bookmark manager using org-mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Aryadev Chavali + +;; Author: Aryadev Chavali +;; Keywords: + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License Version +;; 2 as published by the Free Software Foundation. + +;; 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: + +;; + +;;; Code: + +(require 'org) + +(defvar +bookmark/file (expand-file-name "~/Text/bookmarks.org")) +(defvar +bookmark/mpv-args "--ytdl-raw-options=force-ipv4= --ytdl-format=22") + +(defun +bookmark/bookmarks () + (with-current-buffer (find-file-noselect +bookmark/file) + (org-scan-tags + #'(lambda nil + (let ((heading-components (org-heading-components))) + (cons + (concat (nth 4 heading-components) (nth 5 heading-components)) + (substring-no-properties (org-agenda-get-some-entry-text + (point-marker) + most-positive-fixnum))))) + (cdr (org-make-tags-matcher ":bookmark:")) + nil))) + +(defun +bookmark/open-bookmark () + (interactive) + (let* ((bookmarks (+bookmark/bookmarks)) + (choice (completing-read "Choose bookmark: " + (mapcar #'car bookmarks) + nil t)) + (pair (assoc choice bookmarks #'string=))) + (if (null pair) + (error (format "`%s' is not a valid bookmark" choice)) + (message "[bookmark]: Opening `%s`" (car pair)) + (cond + ((or + (string-match-p "^https://\\(www.\\)?youtu\\(.\\)?be" (cdr pair)) + (string-match-p "\\.mp4$" (cdr pair))) + ;; Open MPV + (message "[bookmark]: Starting MPV process") + (with-current-buffer (get-buffer-create "*mpv*") + (ansi-color-for-comint-mode-on) + (comint-mode)) + (set-process-filter (start-process-shell-command + "bookmark-mpv" "*mpv*" + (concat + "mpv " + +bookmark/mpv-args + " \"" + (cdr pair) + "\"")) + #'comint-output-filter)) + (t + (message "[bookmark]: Starting eww") + (eww (cdr pair))))))) + +(provide 'org-bookmark) +;;; bookmark.el ends here -- cgit v1.2.3-13-gbd6f