Load and hooks order:
~/.emacs.d/early-init.el
~/.emacs.d/core/me-lib.el
~/.emacs.d/core/me-vars.el
$MINEMACSDIR/early-config.el
(unless disabled in$MINEMACS_IGNORE_USER_CONFIG
)$MINEMACSDIR/local/early-config.el
(unless disabled)
before-init-hook
~/.emacs.d/init.el
~/.emacs.d/early-init.el
(ensure it is loaded, in case we started Emacs without early-init)$MINEMACSDIR/custom-vars.el
~/.emacs.d/core/me-loaddefs.el
$MINEMACSDIR/init-tweaks.el
(unless disabled)$MINEMACSDIR/local/init-tweaks.el
(unless disabled)$MINEMACSDIR/local/modules.el
(unless disabled)~/.emacs.d/core/me-bootstrap.el
~/.emacs.d/core/me-builtin.el
~/.emacs.d/modules/<MODULE>.el
(for inminemacs-modules
)minemacs-after-loading-modules-hook
$MINEMACSDIR/config.el
(unless disabled)$MINEMACSDIR/local/config.el
(unless disabled)
after-init-hook
emacs-startup-hook
minemacs-after-load-theme-hook
(after applyingminemacs-theme
)minemacs-after-startup-hook
minemacs-lazy-hook
(hooks are incrementally loaded via a timer)
Special hooks defined with +make-first-file-hook!
minemacs-first-file-hook
minemacs-first-elisp-file-hook
minemacs-first-python-file-hook
minemacs-first-org-file-hook
minemacs-first-c/c++-file-hook
Level of printed messages.
1 - +error!
2 - +info!
3 - +log!
4 - +debug!
The theme of MinEmacs.
List of packages to be disabled when loading MinEmacs modules. This can be useful if you want to enable a module but you don't want a package of being enabled.
This hook will be run after loading MinEmacs modules.
It is used internally to remove the +use-package--check-if-disabled:around-a
advice we set on use-package
in me-bootstrap
.
Runs after setting MinEmacs fonts, runs at the end of +setup-fonts
.
Runs after loading MinEmacs theme, runs at the end of +load-theme
.
This hook will be run after loading Emacs.
MinEmacs hooks will be run in this order:
minemacs-after-startup-hook
minemacs-lazy-hook
This hook will be run after loading Emacs, with laziness.
MinEmacs hooks will be run in this order:
minemacs-after-startup-hook
minemacs-lazy-hook
MinEmacs proxies.
Example, set it to:
='(("no" . "localhost,127.0.0.1,.local,.mylocaltld") ("ftp" . "http://myproxy.local:8080/") ("http" . "http://myproxy.local:8080/") ("https" . "http://myproxy.local:8080/")))
These will set the environment variables "no_proxy", "ftp_proxy", ...
When set in "early-config.el" or in "init-tweaks.el", MinEmacs will enable it automatically.
MinEmacs enabled modules.
Make sure these packages are updated from ELPA.
The file in which the environment variables will be saved.
Environment variables to omit.
Each string is a regexp, matched against variable names to omit from
+env-file
when saving evnironment variables in +env-save
.
List of extra on-demand modules.
Enable loading on-demand packages when needed based on :auto-mode
.
Enable loading on-demand packages when needed based on :magic-mode
.
Enable loading on-demand packages when needed based on :interpreter-mode
.
Enable loading on-demand companion packages when needed.
The default delay (in seconds) to consider in +eval-when-idle!
macro.
The default delay (in seconds) to consider in +lazy!
macro.
A list of files to ignore in the minemacs-first-*-file-hook
.
A list of defined hooks using +make-first-file-hook!
.
Modes for which Eglot can be automatically enabled by +eglot-auto-enable
.
Enable or disable opening suitable files in hexl-mode
.
A list of paths to scan and add to known projects list. It can be a list of strings (paths) or a list of ("~/path" . recursive-p) to scan directories recursively.
List of super-project markers.
Default directory to store serialized symbols.
MinEmacs fonts used by +setup-fonts
.
The function checks and enables the first available font from these defined in this plist. This variable can be customized to set font specs for specific Emacs faces or to enable some language-specific fonts. The plist keywords are either face names or script names expressed as keywords (with the ":" prefix).
For example to set default
face, use :default
, to set the mode-line
face,
use :mode-line
, and so on. The parameters for each font in these cases (ie.
for face names) are used in the custom-theme-set-faces
function, so you can
pass any specs (key value pairs) supported by custom-theme-set-faces
(like
:weight
, :slant
, :foreground
, ...). A list of supported keywords are
available in the variable +face-attributes
.
You can also setup some language-specific fonts. All scripts supported by Emacs
can be found in +known-scripts
. The keyword in this plist will be the script
name expressed as a keyword, for example, for latin
use :latin
, for arabic
use :arabic
, for emoji
use :emoji
, and so on. In this case, the parameters
are used with set-fontset-font
, so you can send any key value pair supported
by set-fontset-font
. A list of supported keywords in this case is available in
+font-spec-keywords
.
The value of the extra :prepend
keyword is passed the last argument to
set-fontset-font
. The value of the extra :scale
keyword can be used to set a
scaling factor for the font in Emacs' face-font-rescale-alist
. See the
+setup-fonts
implementation for more details.
The default backend to convert HTML files to PDFs in +html2pdf
.
A config file to use with the backend tool (pandoc, weasyprint, ...).
The executable for "single-file" which is used archive HTML pages.
The default port (device) to use.
The default baudrate to use.
A list of commands to run in the serial terminal after creation.
A delay to wait before taking the screenshot.
Applicable only when calling +screenshot-svg
with a prefix.
A list of buffer names to be killed without confirmation.
The MPV command.
Path to save user rules.
Per-account alias list.
Auto add this/these addresses as BCC.
Gmail accounts that do not contain "gmail" in address and maildir.
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
.
Maximum image width as a percentage of the window width.
The minimum and maximum width of a displayed image.
Automatically convert Org keywords and properties to lowercase on save.
Generate MinEmacs' loaddefs file.
Delay evaluating BODY with priority 0 (high priority).
Delay evaluating BODY with priority 1.
Get KEYWORD's value from variable value length VPLIST. Ex: (+varplist-get '(:a 'a :b 'b1 'b2) :b) -> '(b1 b2).
Return the keys of PLIST.
Push KEY-VALS to PLIST.
Create a single property list from all plists in PLISTS.
Modified from org-combine-plists
. This supposes the values to be vectors,
and concatenate them.
Delete property PROP from PLIST.
Adapted from org-plist-delete
.
Convert PLIST to an alist, trim first colon when TRIM-COL.
Convert ALIST to a plist, add colon to the keys when ADD-COL.
Set property KEY to VAL in ALIST. Return new alist.
This creates the association if it is missing, and otherwise sets the cdr of the
first matching association in the list. It does not create duplicate
associations. By default, key comparison is done with equal
. However, if
SYMBOL is non-nil, then eq
is used instead.
This method may mutate the original alist, but you still need to use the return
value of this method instead of the original alist, to ensure correct results.
Insert into LIST-VAR an ELEMENT at INDEX. If INDEX is 0, ELEMENT is inserted before the first element.
Duplicate elements in MODE-ALIST to include Treesit modes. For the alist =((some-mode . spec)), this will add =(some-ts-mode . spec).
Return EXPR unquoted. This function does not change global state, including the match data.
Return t when EXPR is quoted.
Like apply-partially
, but apply the ARGS to the right of FUN.
Log error MSG and VARS using message
.
Log info MSG and VARS using message
.
Log MSG and VARS using message
when minemacs-verbose-p
is non-nil.
Log debug MSG and VARS using message
when minemacs-msg-level
is 4.
Suppress new messages temporarily while evaluating BODY.
This inhebits both the echo area and the *Messages*
buffer. If :log
is
provided as the first argument, inhibit messages but keep writing them to the
*Messages*
buffer.
Call FN with ARGS while to suppressing the messages in echo area.
If minemacs-verbose-p
is non-nil, do not print any message to
Messages buffer.
Load Emacs' theme from minemacs-theme
.
Queue FNS to be processed when Emacs becomes idle after DELAY seconds.
Evaluate BODY when Emacs becomes idle.
Evaluate BODY after DELAY seconds from Emacs becoming idle.
Run BODY after Emacs gets loaded, a.k.a. after minemacs-loaded
.
Run BODY as a lazy block (see minemacs-lazy
).
Make a hook which run on the first FILETYPE file of a particular extensions.
The extension should matches EXT-REGEXP.
This will creates a function named +first-file--FILETYPE-h
which gets executed
before after-find-file
. This function will run on the first file that matches
EXT-REGEXP. When it runs, this function provides a feature named
minemacs-first-FILETYPE-file
and a run all hooks in
minemacs-first-FILETYPE-file-hook
.
Convert a list of modes into a list of hook symbols. If a mode is quoted, it is left as is. If the entire HOOKS list is quoted, the list is returned as-is. This function does not change global state, including the match data.
HOOKS REST SINGLES ADVICE-HOW.
Set buffer-local variables on HOOKS.
HOOKS can be expect receiving arguments (like in enable-theme-functions
), the
args
variable can be used inside VAR-VALS forms to get the arguments passed
the the function.
(+setq-hook! 'enable-theme-functions
current-theme (car args))
Set buffer-local variables as HOW advices for FUNCS.
FUNCS can be expect receiving arguments, the args
variable can
be used inside VAR-VALS forms to get the arguments passed the the
function.
(+setq-advice! #'revert-buffer :before
revert-buffer-function
#'ignore)
Unbind setq hooks on HOOKS for VARS.
Add ROOTS to ignored projects, recentf, etc.
Is package PACKAGE disabled in minemacs-disabled-packages
.
Optionally, check also for the containing MODULE.
Check if the PACKAGE has been configured by MinEmacs. This is only valable after loading all modules (in the user's "config.el").
List all the available modules. With optional INCLUDE-ON-DEMAND and INCLUDE-OBSOLETE.
Show the documentation for a random command. Consider only documented, non-obsolete interactive functions.
Execute shell command COMMAND and return its output as a string.
Works like shell-command-to-string
with three differences:
- It uses
+shell-command-switch
instead ofshell-command-switch
. - It returns only stdout and ignore the output of stderr.
- It sets TERM to "smart" instead of "dumb", to be able to escape from Emacs-specific early exit in ".bashrc".
Load environment variables from shell and save them to +env-file
.
Load environment variables from +env-file
.
Return a string with the contents of FILENAME.
Return a list of sub-directories in DIR.
Concatenate PATH-PARTS to construct a path and return it. Ensure the path exists, if not create it. The exact behavior is to create the parent directory if the path is a file, and if the path is a directory, create that directory.
Return non-nil if the resource NAME is locked.
Return non-nil if the resource NAME locked by the current Emacs instance.
Lock the resource named NAME.
Unlock the resource named NAME if locked by this process. If FORCE-P is non-nil, force unlocking even if the resource is not locked by the current process.
Define +CMD command to run BODY in a dedicated tab.
If not specified, BODY defaults to (CMD)
.
You can pass an exit hook or exit function on which, the created workspace will
be deleted.
Auto-enable Eglot in configured modes in +eglot-auto-enable-modes
.
Add all modes in MODE-LIST to +eglot-auto-enable-modes
.
Register MODES with LSP SERVERS. Examples: (+eglot-register 'vhdl-mode "vhdl_ls") (+eglot-register 'lua-mode "lua-language-server" "lua-lsp") (+eglot-register '(c-mode c++-mode) '("clangd" "--clang-tidy" "-j=12") "ccls")
Scan and remember projects under DIR or +project-scan-dir-paths
.
Find super-project root starting from DIR.
Define PACKAGE's COMMANDS for super-project context.
Return the root of PROJ using several backends, don't fail.
Get a list of enabled proxies.
Set PROXIES.
Set *_proxy Linux environment variables from PROXIES.
Unset *_proxy Linux environment variables.
Run BODY without proxies. Doesn't work with emacs-async
.
Example:
(+with-no-proxies! (async-shell-command "git fetch --all")).
Serialize SYM to DIR. If FILENAME-FORMAT is non-nil, use it to format the file name (ex. "file-%s.el"). Return the written file name, or nil if SYM is not bound.
Deserialize SYM from DIR, if MUTATE is non-nil, assign the object to SYM. If FILENAME-FORMAT is non-nil, use it to as a format (ex. "file-%s.el"). Return the deserialized object, or nil if the SYM.el file dont exist.
Check if FONT-FAMILY is installed on the system.
Set font for SCRIPT-OR-FACE from minemacs-fonts-plist
.
Setup fonts.
Subtle look for the mode-line.
Load extra mode if available.
Load companion packages for the current buffer's mode.
Load companion packages applicables to the current's buffer mode.
Try to automatically enable a mode for the current buffer.
Try to automatically enable a mode for FILENAME.
Try to automatically enable a mode based on the :interpreter-mode
value.
Run the hooks in prog-mode-hook
.
Load user configurations CONFIGS.
Load a file, the FILENAME-PARTS are concatenated to form the file name.
Is features FEATS are enabled in this Emacs build.
When the first argument is :any
, this returns t if at least one of the
FEATS is available.
Run all build functions in minemacs-build-functions
.
Call functions without asking when DONT-ASK-P is non-nil.
Update MinEmacs packages to the last revisions (can cause breakages).
Upgrade the packages list to the locked revisions. This takes into account the explicitly pinned packages. When called with C-u or with PULL-MINEMACS, it will run "git pull" in MinEmacs directory before upgrading.
Cleanup MinEmacs' root directory.
Prune straight.el build directories for old Emacs versions.
Cleanup unwanted files/directories from MinEmacs' directory.
Set some Emacs variables for better (!) performance.
Interactively install and load MODULES that aren't enabled in "modules.el". When called with C-u, it prompts also for on-demand modules. When called with C-u C-u, it prompts also for obsolete modules.
Return a unique file name for FILENAME. If "file.ext" exists, returns "file-0.ext".
Delete PATH. If PATH is not specified, default to the current buffer's file. If FORCE-P, delete without confirmation.
Delete FILE-OR-DIRECTORY with delete-file
or delete-directory
.
Move to trash when TRASH is non-nil, delete directories recursively when
RECURSIVE is non-nil.
Delete FILENAME and its associated visiting buffer.
Save (copy) the file name of this buffer to the kill ring.
Get the list of the patches A/B files mentioned in PATCH-BUFF.
Apply PATCH-BUF to the relevant file in PROJ-DIR. When a region is active, propose to use it as the patch buffer.
Clean FILENAME, optionally convert to DOWNCASE-P.
Convert HTML file INFILE to PDF and save it to OUTFILE.
When BACKEND is provided, the corresponding program is used, otherwise, the
value of +html2pdf-default-backend
is used.
Convert plain-text file INFILE to HTML and save it to OUTFILE. When MAIL-MODE-P is non-nil, --mailmode is passed to "txt2html".
Save URL as PDF.
This function's signature is compatible with browse-url-browser-function
so it can be used to save HTML pages or emails to PDF.
When MAIL-MODE-P is non-nil, treat INFILE as a mail.
Save URL into OUT-FILE as a standalone HTML file.
Browser HTML FILE following +browse-html-file-browser-priority
.
If no function from +browse-html-file-browser-priority
is available,
use browse-url
.
When called with universal argument, open the current buffer's file.
Is there a serial port terminal running?
Run COMMANDS on a device via serial communication.
If PORT or BAUD are nil, use values from +serial-port
and +serial-baudrate
.
Get the IP-address for device DEV (default: eth0) of the current machine.
Get the latest release of REPO. Strips the "v" at left. Fallback to FALLBACK-RELEASE when it can't get the last one. When TRIM-V-PREFIX is non-nil, trim the "v" prefix from the version.
Reload directory-local for the current buffer.
Reload dir-locals for all buffers in the current default-directory
.
Toggle autoloading dir-local variables after editing the ".dir-locals" file. If ENABLE is non-nil, force enabling autoreloading.
Open or create the dir-locals.el for the current project.
Get the font faces at POS.
Save a screenshot of the current frame as an SVG image to OUTFILE.
If launched with a prefix or universal argument, it waits for a moment (defined
by +screenshot-delay
) before taking the screenshot.
Kill the minibuffer when switching to window with mouse.
Return the region or the thing at point.
If LEAVE-REGION-MARKED is no-nil, don't call desactivate-mark
when a region is selected.
Insert region or symbol in the minibuffer.
Kill selected region if region is active. Otherwise kill a backward word.
Kill forward whitespace or word.
With argument ARG, do this that many times.
Restricts the effect of kill-word
to the current line.
Kill backward whitespace or word.
With argument ARG, do this that many times.
Restricts the effect of backward-kill-word
to the current line.
Change the indentation size to WIDTH of the current buffer.
The effectiveness of this command is significantly improved if
you have editorconfig
or dtrt-indent
installed.
Go to line N, like goto-line
but for Lisp code.
Add the ;;;###autoload to region (BEG . END).
To be used as a replacement for webjump-read-string
, PROMPT.
Like webjump
, with initial query filled from +region-or-thing-at-point
.
Show inheritance hierarchy for the thing at point. If DERIVED is non-nil (interactively, with prefix argument), show the children of class at point.
Request documentation for the thing at point.
Restart the Emacs server.
Return whether BUFFER or the current buffer is binary. A binary buffer is defined as containing at least one null byte. Returns either nil, or the position of the first null byte.
Is FILE a binary? This checks the first CHUNK of bytes, defaults to 1024.
Does BUFFER (defaults to the current buffer) should be viewed using hexl-mode
.
Activate hexl-mode
if relevant for the current buffer.
Kill BUFFER and delete its windows.
Default is current-buffer
. When MSGP is non-nil, signal an error when
the buffer isn't alive. BUFFER may be either a buffer or its name (a
string).
Copy region to BUFFER: At beginning (prefix >= 0), end (< 0), or replace.
START and END are the region boundaries.
BUFFER is a buffer or its name (a string).
With prefix ARG >= 0: append-to-buffer
:
Append contents of region to end of BUFFER.
(Point is moved to end of BUFFER first.)
With prefix ARG < 0: prepend-to-buffer
:
Prepend contents of region to beginning of BUFFER.
(Point is moved to beginning of BUFFER first.)
With no prefix ARG (nil): copy-to-buffer
.
Write region to BUFFER, replacing any previous contents.
With prefix arg, this is append-to-file
. Without, it is write-region
.
START and END are the region boundaries.
Prefix ARG non-nil means append region to end of file FILENAME.
Prefix ARG nil means write region to FILENAME, replacing contents.
Kill some buffers. Asks the user whether to kill the modified ones.
Non-interactively, if optional argument LIST is non-nil, it
specifies the list of buffers to kill, asking for approval for each one.
See kill-some-buffers
.
Like kill-buffer-ask
, but don't ask if BUFFER isn't modified.
Kill without asking for buffer names in +kill-buffer-no-ask-list
.
Delete all other windows showing the selected window's buffer.
Delete selected window. If no other window shows its buffer, kill the buffer too.
Replace OLD with NEW in the current buffer.
Replace french ponctuations (like unsectable space) by regular ones.
Call save-buffer
, but keep the visited file's modtime the same.
Kill (copy) region as one paragraph. This command removes new line characters between lines.
Return t when the first line of the buffer is empty.
Forget all known projects that don't exist any more.
Like project-forget-zombie-projects
, but handles remote projects differently,
it forget them only when we are sure they don't exist.
Invoke gdb
in the project's root.
Forget all duplicate known projects (like /home/user/proj and ~/proj).
Initialize project list from +project-root-wildcards
.
Find references to the identifier at or around point.
Extract the descriptions of MinEmacs packages.
Show the list of declared external dependencies.
Bump version LEVEL (auto
, major
, minor
or patch
), and with PRE if it
is a pre-release.
This command stashes the current workspace before bumping the version, and
restores it after that.
A function to use as a value of eglot-workspace-configuration
.
It generates the workspace configuration dynamically, taking into account
changed values of eglot-ltex-language
, eglot-ltex-dictrionary
, and so on.
Enable Eglot hack to handle code actions of LTeX-LS.
Disable Eglot hack to handle code actions of LTeX-LS.
Generate selection strings for PARTS.
Use completing-read
to select a single attachment.
Acts like a singular mu4e-view-save-attachments
, without the saving.
Select an attachment, and open it.
Select a MIME part, and perform an action on it.
Save all files from the current view buffer.
With ASK-DIR is non-nil, user can specify the target-directory; otherwise
one is determined using mu4e-attachment-dir
.
Register a mu4e context named LABEL, located in MAILDIR.
LETVARS contains the alist of local variables with their values.
If DEFAULT-P is non-nil, the context is placed first and considered the default
one. If GMAIL-P is non-nil, addresses are saved to +mu4e-gmail-accounts
to be
used later for Gmail specific actions.
Copy MSG at point to somewhere else as _.eml.
Save current MSG as PDF. If SKIP-HEADERS is set, do not show include message headers.
Setup locks for mu4e's server.
Return the "from" address if it is in the registred Gmail accounts. If MSG is provided, use it, else, extract the "from" field from the envelope of the current message.
Apply a face from +mu4e-header-colorized-faces
to STR.
If HERRING is set, it will be used to determine the face instead of STR.
Will try to make unique when non-nil UNIQUE,
a quoted symbol for a alist of current strings and faces provided.
Apply UI setup.
Apply UI tweaks based on nerd-icons
.
Toggle whether LaTeX fragments are numbered. Force enabling when ENABLE is non-nil.
Advice function to inject latex code before and/or after the equation in a latex fragment.
You can use this to set \mathversion{bold} for example to make it bolder.
The way it works is by defining :latex-fragment-pre-body and/or
:latex-fragment-post-body in the variable org-format-latex-options
. These
strings will then be injected before and after the code for the fragment before
it is made into an image.
Toggle whether you can insert latex in fragments.
Lower case Org keywords and properties and block identifiers. Example: "#+TITLE" -> "#+title" "#+BEGIN_EXAMPLE" -> "#+begin_example" ":PROPERTIES:" -> ":properties:".
Enable responsive images' size.
Enable LaTeX equations renumbering.
Enable multi-files documents.
Setup some extra LaTeX classes.
Fix the font size issue in Org's outline in the echo area.
Enable prettifing Org's LaTeX fragments.
Automatically convert KEYWORDS to lower case on save.
Enable all Org-mode extra tweaks.