Skip to content

Commit

Permalink
refactor: define MinEmacs sub-groups
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Mar 23, 2023
1 parent 5c30bcd commit a8f563c
Show file tree
Hide file tree
Showing 20 changed files with 89 additions and 37 deletions.
2 changes: 1 addition & 1 deletion core/me-defaults.el
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
'(prog-mode conf-mode org-mode markdown-mode
latex-mode tex-mode bibtex-mode)
"Enable auto white space cleanup before saving for these derived modes."
:group 'minemacs
:group 'minemacs-edit
:type '(repeat symbol))

;; When MinEmacs is running in an asynchronous Org export context, there is no
Expand Down
4 changes: 2 additions & 2 deletions core/me-modules.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
me-core-ui ; Core UI (doom-themes, modus-themes, doom-modeline, ...)
me-completion) ; Completion (vertico, marginalia, corfu, cape, consult, embark, ...)
"MinEmacs enabled core modules."
:group 'minemacs
:group 'minemacs-core
:type '(repeat symbol))

(defcustom minemacs-modules
Expand Down Expand Up @@ -50,5 +50,5 @@
me-binary ; Display binary files in hex or decompile them (hexl, ...) ...
me-window) ; Frame & window tweaks
"MinEmacs enabled modules."
:group 'minemacs
:group 'minemacs-core
:type '(repeat symbol))
48 changes: 36 additions & 12 deletions core/me-vars.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@
(defgroup minemacs nil
"MinEmacs specific functionalities.")

(defgroup minemacs-core nil
"MinEmacs core tweaks."
:group 'minemacs)

(defgroup minemacs-ui nil
"MinEmacs UI tweaks."
:group 'minemacs)

(defgroup minemacs-edit nil
"MinEmacs editor tweaks."
:group 'minemacs)

(defgroup minemacs-prog nil
"MinEmacs programming stuff."
:group 'minemacs)

(defgroup minemacs-keybinding nil
"MinEmacs keybinding."
:group 'minemacs)

(defgroup minemacs-utils nil
"MinEmacs utility functions."
:group 'minemacs)

(defconst minemacs-config-dir
(file-name-as-directory
(or (getenv "MINEMACS_DIR")
Expand Down Expand Up @@ -38,7 +62,7 @@
2 - `+info!'
3 - `+log!'
4 - `+debug!'"
:group 'minemacs
:group 'minemacs-core
:type '(choice
(const :tag "Error" 1)
(const :tag "Info" 2)
Expand Down Expand Up @@ -76,7 +100,7 @@ Compiled from the `system-configuration-features'.")

(defcustom minemacs-fonts nil
"Fonts to use within MinEmacs."
:group 'minemacs
:group 'minemacs-ui
:type '(plist
(:font-family string)
(:font-size natnum)
Expand All @@ -86,37 +110,37 @@ Compiled from the `system-configuration-features'.")

(defcustom minemacs-leader-key "SPC"
"MinEmacs leader key."
:group 'minemacs
:group 'minemacs-keybinding
:type 'string)

(defcustom minemacs-localleader-key "SPC m"
"MinEmacs local leader (a.k.a. mode specific) key sequence."
:group 'minemacs
:group 'minemacs-keybinding
:type 'string)

(defcustom minemacs-global-leader-prefix "C-SPC"
"MinEmacs general leader key."
:group 'minemacs
:group 'minemacs-keybinding
:type 'string)

(defcustom minemacs-global-mode-prefix "C-SPC m"
"MinEmacs general local leader (a.k.a. mode specific) key sequence."
:group 'minemacs
:group 'minemacs-keybinding
:type 'string)

(defcustom minemacs-theme 'doom-one-light
"The theme of MinEmacs."
:group 'minemacs
:group 'minemacs-ui
:type 'symbol)

(defcustom minemacs-after-set-fonts-hook nil
"Runs after setting MinEmacs fonts, runs at the end of `+set-fonts'."
:group 'minemacs
:group 'minemacs-ui
:type 'hook)

(defcustom minemacs-after-load-theme-hook nil
"Runs after loading MinEmacs theme, runs at the end of `+load-theme'."
:group 'minemacs
:group 'minemacs-ui
:type 'hook)

(defcustom minemacs-after-startup-hook nil
Expand All @@ -125,7 +149,7 @@ Compiled from the `system-configuration-features'.")
MinEmacs hooks will be run in this order:
1. `minemacs-after-startup-hook'
2. `minemacs-lazy-hook'"
:group 'minemacs
:group 'minemacs-core
:type 'hook)

(defcustom minemacs-lazy-hook nil
Expand All @@ -134,7 +158,7 @@ MinEmacs hooks will be run in this order:
MinEmacs hooks will be run in this order:
1. `minemacs-after-startup-hook'
2. `minemacs-lazy-hook'"
:group 'minemacs
:group 'minemacs-core
:type 'hook)

;; Setup default fonts (depending on the OS)
Expand All @@ -157,7 +181,7 @@ MinEmacs hooks will be run in this order:
"List of the environment variables to saved by `+env-save'.
You need to run Emacs from terminal to get the environment variables.
MinEmacs then save them when calling `+env-save' to be used in GUI sessions as well."
:group 'minemacs
:group 'minemacs-core
:type '(repeat string))


Expand Down
10 changes: 7 additions & 3 deletions elisp/+binary.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@
;; Author: Abdelhak Bougouffa (concat "abougouffa" "@" "fedora" "project" "." "org")


(defgroup minemacs-binary nil
"MinEmacs binary files."
:group 'minemacs)

(defcustom +binary-objdump-executable (executable-find "objdump")
"Path to the executable \"objdump\" utility."
:group 'minemacs
:group 'minemacs-binary
:type 'string)

(defcustom +binary-objdump-enable t
"Enable or disable disassembling suitable files with objdump."
:group 'minemacs
:group 'minemacs-binary
:type 'boolean)

(defcustom +binary-hexl-enable t
"Enable or disable openning suitable files in `hexl-mode'."
:group 'minemacs
:group 'minemacs-binary
:type 'boolean)

;;;###autoload
Expand Down
6 changes: 5 additions & 1 deletion elisp/+buffer.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
;; Author: Abdelhak Bougouffa (concat "abougouffa" "@" "fedora" "project" "." "org")


(defgroup minemacs-buffer nil
"MinEmacs buffer stuff."
:group 'minemacs)

;; From: emacswiki.org/emacs/download/misc-cmds.el
;; Candidate as a replacement for `kill-buffer', at least when used interactively.
;; For example: (define-key global-map [remap kill-buffer] 'kill-buffer-and-its-windows)
Expand Down Expand Up @@ -103,7 +107,7 @@ See `kill-some-buffers'."
(defcustom +kill-buffer-no-ask-list
(list messages-buffer-name "*Warnings*")
"A list of buffer names to be killed without confirmation."
:group 'minemacs
:group 'minemacs-buffer
:type '(repeat string))

(with-eval-after-load 'comp
Expand Down
2 changes: 1 addition & 1 deletion elisp/+emacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ If ENABLE is non-nil, force enabling autoreloading."
(defcustom +screenshot-delay 5
"A delay to wait before taking the screenshot.
Applicable only when calling `+screenshot-svg' with a prefix."
:group 'minemacs
:group 'minemacs-utils
:type 'number)

;; Inspired by: reddit.com/r/emacs/comments/idz35e/comment/g2c2c6y
Expand Down
2 changes: 1 addition & 1 deletion elisp/+io.el
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation."

(defcustom +html2pdf-default-backend 'wkhtmltopdf
"The default backend to convert HTML files to PDFs in `+html2pdf'."
:group 'minemacs
:group 'minemacs-utils
:type '(choice
(const wkhtmltopdf)
(const htmldoc)
Expand Down
2 changes: 1 addition & 1 deletion elisp/+minemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ If NO-MESSAGE-LOG is non-nil, do not print any message to *Messages* buffer."
(defvar +eval-when-idle--task-num 0)
(defcustom +eval-when-idle-delay 5.0
"The default delay (in seconds) to consider in `+eval-when-idle!' macro."
:group 'minemacs
:group 'minemacs-core
:type 'float)

;;;###autoload
Expand Down
2 changes: 1 addition & 1 deletion elisp/+primitives.el
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ alist, to ensure correct results."

(defcustom +serialized-symbols-directory (concat minemacs-local-dir "+serialized-symbols/")
"Default directory to store serialized symbols."
:group 'minemacs
:group 'minemacs-core
:type 'directory)

;;;###autoload
Expand Down
6 changes: 5 additions & 1 deletion elisp/+project.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
;; Author: Abdelhak Bougouffa (concat "abougouffa" "@" "fedora" "project" "." "org")


(defgroup minemacs-project nil
"MinEmacs project stuff."
:group 'minemacs)

(defcustom +project-scan-dir-paths nil
"A list of paths to scan and add to known projects list.
It can be a list of strings (paths) or a list of (cons \"~/path/to/projects\" recursive?)
to scan directories recursively."
:group 'minemacs
:group 'minemacs-project
:type '(repeat (choice directory (cons directory boolean))))

;;;###autoload
Expand Down
8 changes: 6 additions & 2 deletions elisp/ecryptfs.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@

(require 'epg)

(defgroup minemacs-ecryptfs nil
"MinEmacs eCryptfs."
:group 'minemacs)

(defcustom ecryptfs-private-dir-name "Private"
"eCryptfs private directory name."
:group 'minemacs
:group 'minemacs-ecryptfs
:type 'string)

(defcustom ecryptfs-root-dir "~/.ecryptfs/"
"eCryptfs root configuration directory."
:group 'minemacs
:group 'minemacs-ecryptfs
:type 'directory)

(defvar ecryptfs-wrapping-independent-p (file-exists-p (concat ecryptfs-root-dir "wrapping-independent")))
Expand Down
8 changes: 6 additions & 2 deletions elisp/netextender.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
(defvar netextender-process-name "netextender")
(defvar netextender-buffer-name " *NetExtender*")

(defgroup minemacs-netextender nil
"MinEmacs NetExtender."
:group 'minemacs)

(defcustom netextender-passphrase-file "~/.ssh/sslvpn.gpg"
"GPG encrypted NetExtender connection parameters."
:group 'minemacs
:group 'minemacs-netextender
:type 'file)

(defcustom netextender-command '("~/.local/bin/netextender")
"Custom NetExtender launcher."
:group 'minemacs
:group 'minemacs-netextender
:type '(choice string file))

;; If the command doesn't exist, generate it.
Expand Down
4 changes: 2 additions & 2 deletions modules/extras/me-mu4e-extras.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

(defcustom +mu4e-account-aliases nil
"Per-account alias list."
:group 'minemacs
:group 'minemacs-mu4e
:type '(repeat string))

(defcustom +mu4e-auto-bcc-address nil
"BCC address."
:group 'minemacs
:group 'minemacs-mu4e
:type 'string)

;; Some of these functions are adapted from Doom Emacs
Expand Down
2 changes: 1 addition & 1 deletion modules/extras/me-mu4e-gmail.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
An alist of Gmail addresses of the format \((\"username@domain.com\" . \"account-maildir\"))
to which Gmail integrations (behind the `+gmail' flag of the `mu4e' module) should be applied.
See `+mu4e-msg-gmail-p' and `mu4e-sent-messages-behavior'."
:group 'minemacs
:group 'minemacs-mu4e
:type '(repeat (cons string string)))

(defun +mu4e-msg-gmail-p (msg)
Expand Down
4 changes: 2 additions & 2 deletions modules/extras/me-org-extras.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

(defcustom +org-responsive-image-percentage 0.4
"Maximum image width as a percentage of the window width."
:group 'minemacs
:group 'minemacs-org
:type 'float)

(defcustom +org-responsive-image-width-limits '(400 . 700) ; '(min . max)
"The minimum and maximum width of a displayed image."
:group 'minemacs
:group 'minemacs-org
:type '(cons natnum natnum))

(defvar-local +org-export-to-pdf-main-file nil
Expand Down
6 changes: 5 additions & 1 deletion modules/me-email.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

(defconst +mu4e-load-path "/usr/share/emacs/site-lisp/mu4e/")

(defgroup minemacs-mu4e nil
"MinEmacs mu4e tweaks."
:group 'minemacs)

(defconst +mu4e-available-p
(and (executable-find "mu")
(executable-find "msmtp")
Expand Down Expand Up @@ -167,7 +171,7 @@
(when (or os/linux os/bsd)
'("paplay" . "/usr/share/sounds/freedesktop/stereo/message.oga"))
"A cons list of the command and arguments to play the notification bell."
:group 'minemacs
:group 'minemacs-mu4e
:type '(cons string string))
:config
;; Enable on mu4e notifications in doom-modeline
Expand Down
2 changes: 1 addition & 1 deletion modules/me-lsp.el
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
js-mode js-ts-mode typescript-mode typescript-ts-mode
json-mode json-ts-mode js-json-mode)
"Modes for which LSP-mode can be automatically enabled by `+lsp-auto-enable'."
:group 'minemacs
:group 'minemacs-prog
:type '(repeat symbol))
:config
(defun +lsp-auto-enable ()
Expand Down
2 changes: 1 addition & 1 deletion modules/me-natural-langs.el
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
font-lock-keyword-face
font-lock-variable-name-face)))
"Faces in certain major modes that spell-fu will not spellcheck."
:group 'minemacs
:group 'minemacs-ui
:type '(repeat (cons symbol (repeat face))))

(add-hook
Expand Down
4 changes: 4 additions & 0 deletions modules/me-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
;; Author: Abdelhak Bougouffa (concat "abougouffa" "@" "fedora" "project" "." "org")


(defgroup minemacs-org nil
"MinEmacs org-mode tweaks."
:group 'minemacs)

(use-package org
:straight (:type built-in)
:after minemacs-loaded
Expand Down
2 changes: 1 addition & 1 deletion modules/me-prog.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
js-mode js-ts-mode typescript-mode typescript-ts-mode
json-mode json-ts-mode js-json-mode)
"Modes for which Eglot can be automatically enabled by `+eglot-auto-enable'."
:group 'minemacs
:group 'minemacs-prog
:type '(repeat symbol))
:config
(defun +eglot-auto-enable ()
Expand Down

0 comments on commit a8f563c

Please sign in to comment.