Subject: 31.0.50; Byte-compiled code fails to provide feature under specific conditions

From: Alexander Prähauser <[email-masked]>
Date: Sat, 01 Feb 2025 00:46:02 +0000

This is an insanely specific bug and I just pray it's reproducible
because I've spent most of the day isolating it as much as I could. And
also that it's really a bug and not just me doing something stupid.

Step by step recipe:

I have attached two files, d-emacs-xkb and d-emacs-mode. Put them
together into a folder, say, ~/tmp/test/,

Make a directory ~/.emacs.d/test-init-dir/  with an init.el containing the line

(add-to-list 'load-path (directory-file-name "~/tmp/test/"))

Run

emacs --init-directory ~/.emacs.d/test-init-dir/
~/tmp/test/d-emacs-xkb.el

Interactively do byte-compile-file and pick d-emacs-xkb
Interactively save-buffers-kill-emacs

emacs --init-directory ~/.emacs.d/test-init-dir/
~/tmp/test/d-emacs-mode.el

Interacively do byte-compile-file and pick d-emacs-mode
Interactively do eval-expression
(require 'd-emacs-mode)

You'll get an error that d-emacs-mode.elc failed to provide the feature
d-emacs-mode. This is even though the feature is provided in the
el-code.

Notes:
I don' think it's important that you do everything interactively, I just
wanted to be as specific as possible.

You'll get a warning when you byte-compile d-emacs-xkb, but I had the
same bug without getting that warning, before I removed as much as I
could from these files.

d-emacs-xkb references the file

/usr/share/X11/xkb/symbols/test

from my testing it's not important that this file exists.

It's important to close Emacs after compiling d-emacs-xkb. From my
testing, the bug doesn't appear if you just go to d-emacs-mode without
closing Emacs.

I thought part of the problem was that the file d-emacs-mode is named
the same as the mode itself, but that doesn't seem to be the case.
I could swear that I could circumvent the bug by re-naming the
file d-emacs-mode into d-emacs and changing the feature name
accordingly before I started to narrow down the issue, but I tried the
same thing now, with everything non-essential commented out or removed
from the files, and I ran into the same issue even after the renaming.

;;; d-emacs-xkb.el --- Create and draw a coordinate system from an xkb-layout -*- lexical-binding: t; -*-

;; Copyright (C) 2023  Alexander Prähauser

;; Author: Alexander Prähauser <[email-masked]>
;; Package-Requires: ((emacs "29.1"))
;; Version: 1.0
;; Keywords: tools, external
;; URL: https://gitlab.com/nameiwillforget/d-emacs/d-emacs-xkb/

;; This file is part of Daselt.

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; d-emacs-xkb.el is a component of the Daselt Emacs configuration that enables users
;; to create and visualize a keyboard coordinate system based on their X Keyboard
;; Extension (xkb) layout. This module parses specified xkb layout files to extract key
;; bindings across multiple layers, organizing them into Emacs-compatible data structures.
;;
;; Key features include:
;; - **Customization:** Users can specify the location of their xkb layout file, define
;;   row configurations, handle special keys, and map xkb symbol names to Emacs-friendly
;;   representations through various customizable variables.
;;
;; - **Layer Management:** The package supports multiple keyboard layers, allowing for
;;   complex key binding schemes. It can inherit key bindings from parent layouts, ensuring
;;   consistency and reducing redundancy in configurations.
;;
;; - **Symbol Translation:** d-emacs-xkb.el translates xkb symbol names into symbols that
;;   Emacs can interpret, handling special characters, Unicode symbols, and function keys.
;;
;; - **Automatic Layout Generation:** Upon loading, the module automatically reads the
;;   specified xkb file, processes the layout definitions, and generates corresponding
;;   Emacs constants. This ensures that the Emacs environment accurately mirrors the
;;   user's physical keyboard layout.
;;
;; By integrating with the broader Daselt system, d-emacs-xkb.el provides a foundation
;; for advanced key binding strategies and coordinate-based operations within Emacs.
;; This enhances customization capabilities and improves the efficiency of the user's
;; workflow by allowing Emacs to understand and utilize the physical layout of the
;; keyboard effectively.
;;
;; Overall, d-emacs-xkb is designed to bridge the gap between the system's keyboard
;; configuration and Emacs, offering a seamless and customizable experience tailored to
;; the user's specific keyboard setup.

;; **Main Functions:** The main function provided by this package is
;; `d-emacs-xkb-generate-layouts', which reads an xkb-file and converts each of
;; its layouts into a d-emacs-coords-layout. The exact behavior of
;; `d-emacs-xkb-generate-layouts' can be tailored by setting the customs in the
;; group `d-emacs-xkb'.

;;; Code:

;;;; Preamble
;; (require 'd-emacs-base)

(require 'cl-lib)

(defun d-emacs-base-read-line ()
  "Read the current line."
  (declare (ftype (function () t)))
  (buffer-substring-no-properties (line-beginning-position)
                                  (line-end-position)))

(defun d-emacs-base-mark-line (&optional arg)
  "Put mark at end of line, point at beginning.

A numeric prefix ARG means move forward (backward if negative) that many lines,
thus marking a line other than the one point was originally in."
  (declare (ftype (function (&optional integer) integer)))
  (interactive "P")
  (setq arg  (if arg (prefix-numeric-value arg) 0))
  (forward-line arg)
  (push-mark nil t t)
  (goto-char (line-end-position)))

(defun d-emacs-base-uppercase-p (str)
  "Return t if all letters in STR are uppercase."
  (declare (ftype (function (string) boolean))
           (pure t))
  (let ((case-fold-search nil))
    (not (string-match-p "[[:lower:]]" str))))

(defun d-emacs-base-numbers-between (num1 num2 &optional exclude1 exclude2)
  "Generate a list of integers from NUM1 to NUM2, including both.

With optional arguments EXCLUDE1 and EXCLUDE2, don't include num1 repectively
num2."
  (declare (pure t)
           (ftype (function (integer integer &optional boolean boolean) list)))
  (cl-loop for k from (funcall (if exclude1 #'1+ #'identity) num1)
           to (funcall (if exclude2 #'1- #'identity) num2)
           collect k))

(defun d-emacs-base-cardinal (n &optional fromone)
  "Generate a list of integers from 0 to N-1.

If optional argument FROMONE is non-nil, return a list starting from 1 to N
instead."
  (declare (pure t)
           (ftype (function (integer &optional boolean) list)))
  (d-emacs-base-numbers-between 0 n fromone (not fromone)))

(defun d-emacs-base-exists-p (list predicate)
  "Return LIST if at least one element satisfies PREDICATE.

Otherwise return nil.

This function is declared as pure, so please don't use predicates with side
effects."
  (declare (ftype (function (list (function (t) boolean)) list))
           (pure t))
  (cl-loop for elt in list
           do (if (funcall predicate elt) (cl-return t))))

(defun d-emacs-base-index (list &optional fromone)
  "Cons each element of LIST with its position in LIST.

If optional argument FROMONE is non-nil, indices start from 1; otherwise, they
start from 0."
  (declare (pure t)
           (ftype (function (list &optional boolean) list)))
  (cl-mapcar (lambda (index elt)
               (cons index elt))
             (d-emacs-base-cardinal (length list) fromone) list))

(defvar d-emacs-xkb-keep-read-buffers nil)

;;;; Customs
(defgroup d-emacs-xkb
  nil
  "Customization group for d-emacs-xkb."
  :group 'd-emacs
  :prefix "d-emacs-xkb-")

(defcustom d-emacs-xkb-file
  "/usr/share/X11/xkb/symbols/test"
  "Location of the file housing Daselt's xkb layout."
  :type 'directory
  :group 'd-emacs-xkb)

(defcustom d-emacs-xkb-rowlist
  '("D" "C" ("LSGT" "B"))
  "List containing the information for the rows to be read from the layout.

Each element should be either a one-letter string corresponding to a row
letter in XKB (usually E-B) or a list.

If the element is a list, it describes either a row with an unusual length
or includes special keys. In this case:

- If the first element of the list is a number, it is assumed to be the
  length of the row.

- The remaining elements should be strings, with exactly one being a
  one-letter string representing the row letter.

- Strings before and after the one-letter string correspond to special keys
  before and after the regular keys in the row. These special keys are not
  counted in the row length.

For example, ISO layouts contain an additional key in the lower key row
\(the B-row) next to the left Shift key named `LSGT'. Thus, the entry for
this row in the default value of `d-emacs-xkb-rowlist' is a list containing
the strings `LSGT` and `B`. Since there is no number at the beginning of the
list, the number of keys in the row without the special key `LSGT` is taken
to be `d-emacs-xkb-rows-length'."
  :type '(repeat
          (choice
           (string :tag "Row Letter")
           (list
            (optional integer)
            (repeat string))))
  :group 'd-emacs-xkb)

(defcustom d-emacs-xkb-rows-length
  10
  "Length of normal rows in d-xkb-layouts.

Can be overwritten for any particular row using `d-emacs-xkb-rowlist'."
  :type 'natnum
  :group 'd-emacs-xkb)

(defcustom d-emacs-xkb-special-key-names
  '("Delete" "BackSpace" "Tab" "Escape" "Print" "Space" "Up" "Left" "Right" "Down" "Home" "End" "Return")
  "List of control characters and function key names used in Daselt."
  :type '(repeat string)
  :group 'd-emacs-xkb)

(defcustom d-emacs-xkb-remaining-char-mappings
  '(("question" . "?") ("quotedbl" . "\"") ("exclam" . "!") ("grave" . "`") ("acute" . "´") ("asciitilde" . "~") ("bar" . "|") ("percent" . "%") ("equal" . "=") ("dollar" . "$") ("EuroSign" . "€") ("ellipsis" . "…") ("parenleft" . "(") ("numbersign" . "#") ("braceleft" . "{") ("bracketleft" . "\[") ("emdash" . "—") ("division" . "÷") ("parenright" . ")") ("underscore" . "_") ("at" . "@") ("braceright" . "}") ("bracketright" . "]") ("multiply" . "×") ("partialderivative" . "∂") ("radical" . "√") ("minus" . "-") ("plus" . "+") ("degree" . "°"))
  "Alist of symbol names in xkb that have to be translated into symbols in Emacs."
  :type '(repeat (cons string string))
  :group 'd-emacs-xkb)

(defcustom d-emacs-xkb-read-layer-function
  'd-emacs-xkb--generate-layer
  "Function used to generate a d-emacs-xkb-layer from an xkb-file.

Default is `d-emacs-xkb--generate-layer'. Has to be adapted for different
layouts."
  :type 'symbol
  :group 'd-emacs-xkb)

(defcustom d-emacs-xkb-layer-numbers-list
  (d-emacs-base-cardinal 8 t)
  "Layers of the xkb-layout you want to import."
  :type 'natnum
  :group 'd-emacs-xkb)

;;;; Functions
;;;;; Reading d-emacs-xkb-file
(defun d-emacs-xkb--get-key-binding (beg end num keyname)
  "Extract the key binding on layer NUM for the key with name KEYNAME.

The region searched is that from BEG to END. Returns nil if no binding is
found."
  (declare (ftype (function (integer integer integer string) string))
           (side-effect-free t))
  (goto-char beg)
  (if (search-forward keyname end t)
      (progn (beginning-of-line)
             (search-forward "\{" end t)
             (mark-sexp)
             (nth num ; First two entries are brackets, absolute layers start at zero.
                  (split-string
                   (buffer-substring-no-properties (region-beginning)
                                                   (region-end))
                   "[[:space:]]+" t)))
    nil))

(defun d-emacs-xkb--format-special-key (string)
  "Format a STRING describing a control character or function key.

Return a form suitable for Emacs."
  (declare (ftype (function (string) string))
           (pure t))
  (concat "<" (replace-regexp-in-string "_" "-" (downcase string)) ">"))

(defun d-emacs-xkb--format-xkb-signal-name (rawsigname)
  "Format the signal name RAWSIGNAME read by d-emacs-xkb for Emacs.

Removes spaces and NoSymbol's, converts Unicode characters, converts keypad
signal names, and replaces other signal names with their Emacs equivalents."
  (declare (ftype (function (string) string))
           (pure t))
  (let ((signame rawsigname))
    (if rawsigname
        (progn
          ;; Remove tabs, spaces and commas if they exist.
          (setq signame (replace-regexp-in-string "\t" "" signame))
          (setq signame (remove ?\  signame))
          (setq signame (remove ?, signame))

          ;; Remove NoSymbol's.
          (cond
           ((string= signame "NoSymbol")
            (setq signame nil))

           ;; If it's a keypad-signal or a control character, downcase, put <> around it and replace _ with -.
           ((or (string-match-p "KP" signame)
                (member signame d-emacs-xkb-special-key-names))
            (setq signame (d-emacs-xkb--format-special-key signame)))

           ;; Try inserting the signal as a character.
           ((char-from-name signame t)
            (setq signame (char-to-string (char-from-name signame t))))

           ;; If the string starts with a U, is longer than one symbol and all letters are uppercase it's safe to assume it's the code of a unicode symbol and convert it to that symbol.
           ((and (d-emacs-base-uppercase-p signame) (string-match-p "U" (substring signame 0 1))
                 (> (length signame) 1))
            (setq signame (char-to-string (string-to-number (substring signame 1) 16))))

           ;; If it's a Greek letter, create the corresponding name and use it for insertion. Uppercase first.
           ((string-match-p "Greek" signame)
            (setq signame (let ((letter (nth 1 (split-string signame "_"))))
                            (if (d-emacs-base-uppercase-p letter)
                                (char-to-string
                                 (char-from-name (concat "greek capital letter " letter) t))
                              (char-to-string
                               (char-from-name (concat "greek small letter " letter) t))))))

           ;; Replace other symbols
           (t (cl-loop for cand in d-emacs-xkb-remaining-char-mappings
                       do (if (equal (car cand) signame)
                              (setq signame (cdr cand))))))
          signame)
      nil)))

(defun d-emacs-xkb--inherit-from-parent-map (beg end laynum rownum key)
  "Lookup the key binding of a KEY in the parent map of the current map.

The current map is that within the range defined by BEG to END. The key position
is given by LAYNUM, ROWNUM and KEY.

KEY can be a number, corresponding to KEYs with a number (AB01 and such) or a
string, in which case the string is assumed to be its name.

This works only if the parent map appears earlier in the file."
  (declare (ftype (function (integer integer integer integer (or integer string)) string))
           (side-effect-free t))
  (goto-char beg)
  (if (search-forward "include" end t)
      (progn (d-emacs-base-mark-line)
             (let* ((includelinelist (remove "" (split-string (remove ?\" (buffer-substring-no-properties (region-beginning) (region-end)))
                                                              "\\(\(\\|\)\\|[ ]+\\|\_\\)" t)))
                    (parent (nth 2 includelinelist))
                    (parentlayout (symbol-value
                                   (intern (concat "d-emacs-xkb-" parent "-layout"))))
                    (parlayer (nth (1- laynum) parentlayout)) ; Layers start at 1
                    (maxrowlength (apply #'max (mapcar #'length parlayer)))
                    (parrow (nth rownum parlayer))
                    (parrowlength (length parrow)))
               (nth (- (1+ key) (- maxrowlength parrowlength))
                    parrow)))
    nil))

;;;;; Layout generation functions
(defun d-emacs-xkb--generate-layer (beg end laynum)
  "Generate a list from an xkb-layer.

The layer is defined by the region from BEG to END in `d-emacs-xkb-file' and the
layer number LAYNUM."
  (declare (ftype (function (integer integer integer) list))
           (side-effect-free t))
  (mapcar (lambda (indrowinfo)
            (let* ((rowidx (car indrowinfo))
                   (rowinfo (cdr indrowinfo))
                   (rowinfo (if (atom rowinfo) ; Redefine if it's not a list.
                                (list rowinfo)
                              rowinfo))
                   (rowlength (if (numberp (car rowinfo))
                                  (car rowinfo)
                                d-emacs-xkb-rows-length))
                   (idx 0)
                   (numbershift (progn (while (not (= 1 (length (nth idx rowinfo))))
                                         (setq idx (1+ idx)))
                                       idx)))
              (cl-loop for eltnum from 0 to (1- (length rowinfo))
                       for elt = (nth eltnum rowinfo)
                       append
                       (if (= 1 (length elt)) ; If it's a row letter.
                           (let* ((rowprefix (concat "A" elt)))
                             (mapcar (lambda (keynum)
                                       (let* ((keynumstr (if (>= keynum 10)
                                                             (number-to-string keynum)
                                                           (concat
                                                            "0" (number-to-string
                                                                 keynum))))
                                              (keyname (concat rowprefix keynumstr))
                                              (binding (d-emacs-xkb--format-xkb-signal-name
                                                        (d-emacs-xkb--get-key-binding
                                                         beg end laynum keyname))))
                                         (or binding
                                             (let ((keynum (+ numbershift (1- keynum))))
                                               (d-emacs-xkb--inherit-from-parent-map
                                                beg end laynum rowidx
                                                keynum)))))
                                     (d-emacs-base-cardinal rowlength t)))
                         
                         (let ((binding (d-emacs-xkb--format-xkb-signal-name
                                         (d-emacs-xkb--get-key-binding
                                          beg end laynum elt))))
                           (list (or binding
                                     (d-emacs-xkb--inherit-from-parent-map
                                      beg end laynum rowidx eltnum))))))))
          (d-emacs-base-index d-emacs-xkb-rowlist)))

(defun d-emacs-xkb-generate-layouts ()
  "Generate lists from layouts defined in the `d-emacs-xkb-file'.

This function searches for `xkb_symbols', marks the line, extracts layout names,
and processes them with `d-emacs-xkb--generate-layer' to define the layout.

The structure of xkb-layouts can be faily complex, so this function makes
various simplifying assumptions. In particular it is assumed that all layouts in
the file have the same number of layers."
  (declare (ftype (function () t )))
  (let ((dxkbbuf (find-file-noselect d-emacs-xkb-file))
        defined-layouts)  ; This way we don't overwrite layouts with a base and a full version.
    (set-buffer dxkbbuf)
    (goto-char (point-min))
    (while (re-search-forward (rx "partial" (* blank)
                                  "alphanumeric_keys" (* not-newline) (* (or "\n" blank))
                                  "xkb_symbols")
                              nil t)
      (let ((linebeg (prog2 (beginning-of-line) (point))))
        (progn (d-emacs-base-mark-line)
               (let* ((laynameful
                       (nth 1 (split-string
                               (buffer-substring (region-beginning) (region-end)) " ")))
                      (layname (remove ?\" (if (string-match-p "base" laynameful)
                                               (car (split-string laynameful "_"))
                                             laynameful))))

                 (progn (goto-char linebeg)
                        (search-forward "\{" nil t)
                        (backward-char)
                        (mark-sexp)
                        (unless (d-emacs-base-exists-p defined-layouts
                                                       (lambda (previous-layname)
                                                         (string= layname previous-layname)))
                          (let ((laybeg (region-beginning)) (layend (region-end)))
                            (set (intern (concat "d-emacs-xkb-" layname "-layout"))
                                 (mapcar (lambda (laynum)
                                           (d-emacs-xkb--generate-layer laybeg layend laynum))
                                         d-emacs-xkb-layer-numbers-list)))
                          (push layname defined-layouts)))))))
    (unless d-emacs-xkb-keep-read-buffers (kill-buffer dxkbbuf))))

;;;;; Set layouts variable
(defun d-emacs-xkb-set-layouts-list ()
  "Set `d-emacs-xkb-layouts' by finding all symbols matching
`d-emacs-xkb-.*layout'."
  (declare (ftype (function () t)))
  (defconst d-emacs-xkb-layouts
    (apropos-internal "d-emacs-xkb-.*-layout" (lambda (sym) (boundp sym)))
    "List of d-emacs-xkb-layouts in unextended form. Generated automatically."))

;;;; Generated Constants
(condition-case nil
    (d-emacs-xkb-generate-layouts)

  ;; Generate layout constants.
  (error "No valid layout file has been provided yet. Please remedy this by setting the custom `d-emacs-xkb-file', then running `d-emacs-xkb-generate-layouts' and `d-emacs-xkb-set-layouts-list' again"))

;;;; Provide
(provide 'd-emacs-xkb)
;;; d-emacs-xkb.el ends here
;;; d-emacs-mode.el --- Provides d-emacs-mode -*- lexical-binding: t; -*-

;; Copyright (C) 2024  Alexander Prähauser

;; Author: Alexander Prähauser <[email-masked]>
;; Package-Requires: ((emacs "29.1"))
;; Version: 1.0
;; Keywords: tools
;; URL: https://gitlab.com/nameiwillforget/d-emacs/d-emacs-mode/

;; This file is part of Daselt.

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; Define `d-emacs-mode', the implementation of the Daselt shortcut-layout in
;; Emacs and provide commands needed to start it. Commands bound to keys are in
;; `pkg-configs/d-emacs/d-emacs-ext.del'.

;;; Code:
;;;; Preamble
(declare-function d-emacs-dirs-act-on-pkg-files-by-type-and-maybe-kill "d-emacs-dirs" (funtypes &optional dir customt sortfun pfx))
(declare-function d-emacs-dirs-create-pkg-customization-options "d-emacs-dirs" (&optional dir group deffun))
(declare-function d-emacs-stump-translated-emacs-keys "d-emacs-stump" nil)
(declare-function d-emacs-stump-translated-emacs-keys "d-emacs-stump" nil)
(declare-function d-emacs-dfk-import-current-layout "d-emacs-dfk" nil)
(declare-function d-emacs-xkb-generate-layouts "d-emacs-xkb" nil)
(declare-function d-emacs-base-read-region "d-emacs-base" (&optional properties))
(declare-function d-emacs-dirs-act-on-sexps-in-file "d-emacs-dirs" (filepath function &optional untangle))
(declare-function d-emacs-bind-string "d-emacs-bind" (binding &optional translate csectoshft doublebind))
(declare-function d-emacs-minor-mode-key-binding "d-emacs-mode-ext" (key))
(declare-function d-emacs-base-cardinal "d-emacs-base" (n &optional fromone))

(defvar d-emacs-global-map-backup)
(defvar undo-tree-auto-save-history)
(defvar d-emacs-dirs-keep-read-buffers)
(defvar d-emacs-base-debug)
(defvar d-emacs-dirs-pkg-configs-directory)
(defvar d-emacs-bind-key-translations-alist)
(defvar d-emacs-replace-untranslated-keys)
(defvar d-emacs-bind-translate-keys)
(defvar d-emacs-bind-translate-C-1-1--2-C-g)
(defvar d-emacs-stump)

;; (require 'd-emacs-base)
;; (require 'd-emacs-coords)
(require 'd-emacs-xkb)
;; (require 'd-emacs-dfk)
;; (require 'd-emacs-bind)
;; (require 'd-emacs-dirs)
;; (require 'cl-lib)
;; (require 'org-table)

;;;; Initialization
;;;;; Customs

;;;; Mode
;;;###autoload
(define-minor-mode d-emacs-mode
  "Daselt's minor mode.

Rebinds most keys and revamps Emacs to implement Daselt's shortcut layout.

`d-emacs-mode' uses a pkg-configs-directory as defined in `d-emacs-dirs' to
store its configuration. When `d-emacs-mode' is started, it has to read all
files in this directory. Depending on your hardware and installed packages this
might take between a few seconds and maybe a minute. If you plan on toggling
`d-emacs-mode' several times you can set `d-emacs-dirs-keep-read-buffers' to t
to reduce the startup time."
  :init-value nil
  :global t
  :interactive t
  :lighter "Daselt"
  ;; (if d-emacs-mode
  ;;     (progn  ;; Set `d-emacs-dirs-pkg-configs-directory' to `d-emacs-mode-pkg-configs-directory' while `d-emacs-mode' is on.
  ;;       (unless (d-emacs-mode--pkg-configs-directory-test d-emacs-dirs-pkg-configs-directory)
  ;;         (if (bound-and-true-p d-emacs-dirs-pkg-configs-directory)
  ;;             (progn (defvar d-emacs-d-emacs-dirs-pkg-configs-directory-backup)
  ;;                    (setq d-emacs-d-emacs-dirs-pkg-configs-directory-backup
  ;;                          d-emacs-dirs-pkg-configs-directory)))
  ;;         (setopt d-emacs-dirs-pkg-configs-directory
  ;;                 d-emacs-mode-pkg-configs-directory))

  ;;       ;; `d-emacs-mode' without translated keys is borderline unusable.
  ;;       (setq d-emacs-bind-translate-keys t)

  ;;       ;; Find out if it's an ansi keyboard
  ;;       (unless (or (not d-emacs-mode-show-tutorial)
  ;;                   (not (eq (custom-variable-state 'd-emacs-dfk-keyboard-layout-type t)
  ;;                            'standard)))
  ;;         (customize-save-variable 'd-emacs-dfk-keyboard-layout-type
  ;;                                  (d-emacs-base-remove-text-properties-from-string
  ;;                                   (completing-read "Do you have an ansi or iso-keyboard (you have ansi if your left Shift-key is larger than CapsLock)? " d-emacs-dfk-supported-layout-types))))

  ;;       (if d-emacs-bind-translate-keys
  ;;           ;; Add the key translations for C-g and ("C-" . (1 1 -2)) if they aren't there yet.
  ;;           (progn (if d-emacs-bind-translate-C-1-1--2-C-g
  ;;                      (let ((transcons
  ;;                             `(,(d-emacs-bind-string `(("C-" . (1 1 -2)))) . "C-g"))
  ;;                            (revtranscons
  ;;                             `("C-g" . ,(d-emacs-bind-string `(("C-" . (1 1 -2)))))))
  ;;                        (add-to-list 'd-emacs-bind-key-translations-alist transcons)
  ;;                        (add-to-list 'd-emacs-bind-key-translations-alist revtranscons)))
  ;;                  (mapc
  ;;                   (lambda (cns) (key-translate (car cns) (cdr cns)))
  ;;                   d-emacs-bind-key-translations-alist)))

  ;;       ;; Refresh the d-emacs-xkb-layouts in case someone has changed bindings.
  ;;       (d-emacs-xkb-generate-layouts)

  ;;       ;; Choose the layout
  ;;       (unless (or (not d-emacs-mode-show-tutorial)
  ;;                   (not (eq (custom-variable-state 'd-emacs-xkb-layout t)
  ;;                            'standard)))
  ;;         (customize-save-variable 'd-emacs-xkb-layout
  ;;                                  (d-emacs-base-intern-from-parts
  ;;                                   "d-emacs-xkb"
  ;;                                   (completing-read
  ;;                                    "Please pick the Daselt layout you want to use: "
  ;;                                    (mapcar (lambda (sym)
  ;;                                              (d-emacs-base-namecore sym
  ;;                                                                     "d-emacs-xkb-"
  ;;                                                                     "-layout"))
  ;;                                            d-emacs-xkb-layouts))
  ;;                                   "layout")))

  ;;       (if d-emacs-mode-redaselt
  ;;           (if (file-exists-p "/usr/share/X11/xkb/symbols/dxkb")
  ;;               (d-emacs-mode-redaselt)
  ;;             (error "Please put the dxkb-file into `/usr/share/X11/xkb/symbols/'")))
        
  ;;       ;; For a non-main layout put modifiers outside the layout unless they have been put in by hand. For the main layout, do it the other way around.
  ;;       (unless (not (eq (custom-variable-state 'd-emacs-dfk-outside-mods t)
  ;;                        'standard))
  ;;         (if (eq (symbol-value 'd-emacs-xkb-layout)
  ;;                 'd-emacs-xkb-main-layout)
  ;;             (setopt d-emacs-dfk-outside-mods nil)
  ;;           (setopt d-emacs-dfk-outside-mods t)))

  ;;       ;; Generate d-emacs-dfk-layout from the d-emacs-xkb-layout.
  ;;       (d-emacs-dfk-import-current-layout)

  ;;       ;; Set constants
  ;;       (when (bound-and-true-p d-emacs-stump)
  ;;         (setopt d-emacs-bind-outside-translations-alist
  ;;                 (d-emacs-stump-translated-emacs-keys))

  ;;         ;; We can also apply the d-emacs-stump-bindlists here.
  ;;         (d-emacs-dirs-act-on-pkg-files-by-type-and-maybe-kill
  ;;          `(((lambda (filename)
  ;;               (d-emacs-dirs-save-bindlists-in-file filename "d-emacs-stump")) . "dbl")
  ;;            ((lambda (filename)
  ;;               (d-emacs-dirs-save-bindforms-in-file filename "d-emacs-stump")) . "dbf"))
  ;;          d-emacs-stump-pkg-configs-directory t nil "d-emacs-stump"))

  ;;       ;; Calculate layer boundaries to simplify calculations by `d-emacs-bind-draw-bindings-from-regexps'.
  ;;       (setq d-emacs-bind-boundaries
  ;;             (list (d-emacs-coords-boundaries
  ;;                    (mapcar (lambda (placeval) (car placeval))
  ;;                            (d-emacs-base-flatten-until
  ;;                             (d-emacs-coords-get-layer
  ;;                              (d-emacs-coords-coordinatize-layout
  ;;                               (symbol-value d-emacs-dfk-layout))
  ;;                              0)
  ;;                             (lambda (lst) (d-emacs-coords-p (caar lst))))))

  ;;                   (d-emacs-coords-boundaries
  ;;                    (mapcar (lambda (placeval) (car placeval))
  ;;                            (d-emacs-base-flatten-until
  ;;                             (d-emacs-coords-get-layer
  ;;                              (d-emacs-coords-coordinatize-layout
  ;;                               (symbol-value d-emacs-xkb-layout))
  ;;                              1)
  ;;                             (lambda (lst) (d-emacs-coords-p (caar lst))))))))

  ;;       ;; Add all files in pkg-configs to the load-path.
  ;;       (let ((default-directory d-emacs-dirs-pkg-configs-directory))
  ;;         (normal-top-level-add-to-load-path '("."))
  ;;         (normal-top-level-add-subdirs-to-load-path))

  ;;       ;; Add pkg-config-options
  ;;       (d-emacs-dirs-create-pkg-customization-options-by-variable d-emacs-mode-pkg-configs-directory)

  ;;       (setopt d-emacs-d-emacs-mode t) ; This should really be enabled (otherwise it won't recurse into the corresponding directory).

  ;;       ;; Quick keys
  ;;       (d-emacs-mode--generate-quick-key-variables)

  ;;       ;; Add to emulation
  ;;       (if d-emacs-mode-put-d-emacs-mode-map-into-emulation
  ;;           (add-to-list 'emulation-mode-map-alists
  ;;                        `((d-emacs-mode . ,d-emacs-mode-map))))

  ;;       (let ((undo-tree-auto-save-history nil) ; Saving undo-state of opened files is useless here and slows down startup.
  ;;             )
  ;;         (d-emacs-dirs-act-on-pkg-files-by-type-and-maybe-kill
  ;;          `((d-emacs-dirs-with-eval-load-elc-or-lispcode-in-file .  "del")
  ;;            (d-emacs-dirs-save-and-with-eval-apply-bindlists-in-file
  ;;             . ("dbl" "regular"))

  ;;            ;; Do rebinding before other operations, that way if something goes wrong, at least the layout is defined.
  ;;            (d-emacs-dirs-save-bindlists-in-file . ("dbl" "special"))
  ;;            (d-emacs-dirs-save-bindforms-in-file . "dbf")
  ;;            (d-emacs-dirs-with-eval-set-constantlists-in-file . ("dcl" "regular"))
  ;;            (d-emacs-dirs-with-eval-add-advicelists-in-file . ("dal" "regular"))
  ;;            (d-emacs-dirs-with-eval-add-adviceforms-in-file . ("daf" "regular")))
  ;;          nil t))

  ;;       (if d-emacs-mode-globalize-d-emacs-mode-map
  ;;           (progn (unless (boundp d-emacs-global-map-backup)
  ;;                    (setq d-emacs-global-map-backup global-map))
  ;;                  (setq global-map d-emacs-mode-map)))

  ;;       (if d-emacs-mode-show-tutorial (d-emacs-mode-generate-tutorial t)))

  ;;   ;; Reset variables and remove advice We have to recurse again instead of
  ;;   ;; simply setting the original variables to their backup values because
  ;;   ;; there is the possibility that otherwise an eval-condition might be
  ;;   ;; triggered after the mode was exited, overriding the restored
  ;;   ;; backup-value.
  ;;   (d-emacs-dirs-act-on-pkg-files-by-type-and-maybe-kill
  ;;    `((d-emacs-dirs-with-eval-remove-advicelists-in-file . ("dal" "regular"))
  ;;      (d-emacs-dirs-with-eval-reset-bindlists-in-file . ("dbl" "regular"))
  ;;      (d-emacs-dirs-with-eval-reset-constantlists-in-file . ("dcl" "regular"))))

  ;;   ;; Let's also reset all global variables that have not been found by the recursion (because their entry was deleted).
  ;;   (d-emacs-dirs--reset-backed-up-variables)

  ;;   ;; Restore the keyboard layout.
  ;;   (if d-emacs-mode-undaselt (d-emacs-mode-undaselt)))
  )

;;;; Provide
(provide 'd-emacs-mode)
;;; d-emacs-mode.el ends here

In GNU Emacs 31.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.41, cairo version 1.18.2) of 2025-01-16 built on gentoolaptop
Repository revision: 16c89c5ae5ec0c002c327793e783f0a943bacb0d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101015
System Description: Gentoo Linux

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: VTerm

Minor modes in effect:
  icicle-mode: t
  minibuffer-depth-indicate-mode: t
  Info-breadcrumbs-in-mode-line-mode: t
  citar-embark-mode: t
  recentf-mode: t
  global-edit-server-edit-mode: t
  global-goto-address-mode: t
  goto-address-mode: t
  auto-insert-mode: t
  dynamic-completion-mode: t
  electric-pair-mode: t
  corfu-history-mode: t
  delete-selection-mode: t
  global-undo-tree-mode: t
  desktop-save-mode: t
  d-emacs-mode: t
  emms-mode-line-mode: t
  emms-playing-time-display-mode: t
  emms-playing-time-mode: t
  global-org-modern-mode: t
  TeX-PDF-mode: t
  fancy-compilation-mode: t
  eshell-vterm-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  all-the-icons-completion-mode: t
  global-aggressive-indent-mode: t
  org-roam-db-autosync-mode: t
  corfu-prescient-mode: t
  global-corfu-mode: t
  corfu-mode: t
  marginalia-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  savehist-mode: t
  smart-mark-mode: t
  windmove-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  tab-bar-history-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  undelete-frame-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/bookmark+ hides /home/alex/.emacs.d/elpa/bookmark+-20230325.160624/bookmark+
/home/alex/.emacs.d/straight/build/corfu-terminal/corfu-terminal hides /home/alex/.emacs.d/elpa/corfu-terminal-0.7/corfu-terminal
/home/alex/.emacs.d/straight/build/corfu-terminal/corfu-terminal-autoloads hides /home/alex/.emacs.d/elpa/corfu-terminal-0.7/corfu-terminal-autoloads
/home/alex/.emacs.d/straight/build/corfu/corfu hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu
/home/alex/.emacs.d/straight/build/corfu/corfu-quick hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-quick
/home/alex/.emacs.d/straight/build/corfu/corfu-popupinfo hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-popupinfo
/home/alex/.emacs.d/straight/build/corfu/corfu-info hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-info
/home/alex/.emacs.d/straight/build/corfu/corfu-indexed hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-indexed
/home/alex/.emacs.d/straight/build/corfu/corfu-history hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-history
/home/alex/.emacs.d/straight/build/corfu/corfu-echo hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-echo
/home/alex/.emacs.d/straight/build/corfu/corfu-autoloads hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-autoloads
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/doremi hides /home/alex/.emacs.d/elpa/doremi-20220406.185820/doremi
/home/alex/.emacs.d/straight/build/consult/consult hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult
/home/alex/.emacs.d/straight/build/consult/consult-xref hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-xref
/home/alex/.emacs.d/straight/build/consult/consult-register hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-register
/home/alex/.emacs.d/straight/build/consult/consult-org hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-org
/home/alex/.emacs.d/straight/build/consult/consult-kmacro hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-kmacro
/home/alex/.emacs.d/straight/build/consult/consult-info hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-info
/home/alex/.emacs.d/straight/build/consult/consult-imenu hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-imenu
/home/alex/.emacs.d/straight/build/consult/consult-flymake hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-flymake
/home/alex/.emacs.d/straight/build/consult/consult-compile hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-compile
/home/alex/.emacs.d/straight/build/consult/consult-autoloads hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-autoloads
/home/alex/.emacs.d/elpa/org-projectile-helm-20230817.801/org-projectile-helm hides /home/alex/.emacs.d/elpa/org-projectile-20230817.851/org-projectile-helm
/home/alex/.emacs.d/straight/build/popon/popon hides /home/alex/.emacs.d/elpa/popon-0.13/popon
/home/alex/.emacs.d/straight/build/popon/popon-autoloads hides /home/alex/.emacs.d/elpa/popon-0.13/popon-autoloads
/home/alex/.emacs.d/elpa/transient-20250108.1351/transient hides /usr/local/share/emacs/31.0.50/lisp/transient
/home/alex/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides /usr/local/share/emacs/31.0.50/lisp/bind-key
/home/alex/.emacs.d/elpa/modus-themes-20250107.1034/theme-loaddefs hides /usr/local/share/emacs/31.0.50/lisp/theme-loaddefs
/home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-lint hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-lint
/home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-jump hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-jump
/home/alex/.emacs.d/elpa/use-package-ensure-system-package-20221209.2013/use-package-ensure-system-package hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-ensure-system-package
/home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-ensure
/home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package
/home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-diminish
/home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-delight hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-delight
/home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-core hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-core
/home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-bind-key
/home/alex/.emacs.d/straight/build/compat/compat hides /usr/local/share/emacs/31.0.50/lisp/emacs-lisp/compat
/home/alex/.emacs.d/straight/build/seq/seq hides /usr/local/share/emacs/31.0.50/lisp/emacs-lisp/seq
/home/alex/.emacs.d/elpa/avy-act-20241226.2351/avy-act hides /home/alex/.emacs.d/site-lisp/avy-act/avy-act
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/hexrgb hides /home/alex/.emacs.d/site-lisp/doremi/hexrgb
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/doremi hides /home/alex/.emacs.d/site-lisp/doremi/doremi
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-fn hides /home/alex/.emacs.d/site-lisp/icicles/icicles-fn
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/vline hides /home/alex/.emacs.d/site-lisp/icicles/vline
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/thingatpt+ hides /home/alex/.emacs.d/site-lisp/icicles/thingatpt+
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/synonyms hides /home/alex/.emacs.d/site-lisp/icicles/synonyms
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/pp+ hides /home/alex/.emacs.d/site-lisp/icicles/pp+
/home/alex/.emacs.d/site-lisp/palette hides /home/alex/.emacs.d/site-lisp/icicles/palette
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/lacarte hides /home/alex/.emacs.d/site-lisp/icicles/lacarte
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/info+ hides /home/alex/.emacs.d/site-lisp/icicles/info+
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icomplete+ hides /home/alex/.emacs.d/site-lisp/icicles/icomplete+
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles hides /home/alex/.emacs.d/site-lisp/icicles/icicles
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-var hides /home/alex/.emacs.d/site-lisp/icicles/icicles-var
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-opt hides /home/alex/.emacs.d/site-lisp/icicles/icicles-opt
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-mode hides /home/alex/.emacs.d/site-lisp/icicles/icicles-mode
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-mcmd hides /home/alex/.emacs.d/site-lisp/icicles/icicles-mcmd
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-mac hides /home/alex/.emacs.d/site-lisp/icicles/icicles-mac
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-face hides /home/alex/.emacs.d/site-lisp/icicles/icicles-face
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-doc2 hides /home/alex/.emacs.d/site-lisp/icicles/icicles-doc2
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-doc1 hides /home/alex/.emacs.d/site-lisp/icicles/icicles-doc1
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-cmd2 hides /home/alex/.emacs.d/site-lisp/icicles/icicles-cmd2
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-cmd1 hides /home/alex/.emacs.d/site-lisp/icicles/icicles-cmd1
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-chg hides /home/alex/.emacs.d/site-lisp/icicles/icicles-chg
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/hl-line+ hides /home/alex/.emacs.d/site-lisp/icicles/hl-line+
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/hexrgb hides /home/alex/.emacs.d/site-lisp/icicles/hexrgb
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/fuzzy-match hides /home/alex/.emacs.d/site-lisp/icicles/fuzzy-match
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/doremi hides /home/alex/.emacs.d/site-lisp/icicles/doremi
/home/alex/.emacs.d/site-lisp/doremi/doremi-frm hides /home/alex/.emacs.d/site-lisp/icicles/doremi-frm
/home/alex/.emacs.d/site-lisp/dired+ hides /home/alex/.emacs.d/site-lisp/icicles/dired+
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/crosshairs hides /home/alex/.emacs.d/site-lisp/icicles/crosshairs
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/col-highlight hides /home/alex/.emacs.d/site-lisp/icicles/col-highlight
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/bookmark+ hides /home/alex/.emacs.d/site-lisp/icicles/bookmark+
/home/alex/.emacs.d/elpa/Icicles-20241217.3924/apropos-fn+var hides /home/alex/.emacs.d/site-lisp/icicles/apropos-fn+var
/home/alex/.emacs.d/elpa/d-emacs-base-20250126.1606/d-emacs-base hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-base/d-emacs-base
/home/alex/.emacs.d/elpa/d-emacs-bind-20250131.1448/d-emacs-bind hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-bind/d-emacs-bind
/home/alex/.emacs.d/elpa/d-emacs-coords-20250126.1606/d-emacs-coords hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-coords/d-emacs-coords
/home/alex/.emacs.d/elpa/d-emacs-dfk-20250126.1606/d-emacs-dfk hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-dfk/d-emacs-dfk
/home/alex/.emacs.d/elpa/d-emacs-dirs-20250130.2316/d-emacs-dirs hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-dirs/d-emacs-dirs
/home/alex/.emacs.d/elpa/d-emacs-tri-20250131.1605/d-emacs-tri hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-tri/d-emacs-tri
/home/alex/.emacs.d/elpa/d-emacs-xkb-20250126.1606/d-emacs-xkb hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-xkb/d-emacs-xkb
/home/alex/.emacs.d/site-lisp/add-tex-envs hides /home/alex/.emacs.d/site-lisp/DEmacs.old/DEmacs/DEmacs-basic/add-tex-envs

Features:
(shadow emacsbug url-misc flow-fill gnus-cite smiley mm-archive
gnus-async gnus-bcklg qp gnus-ml nndraft nnmh nnmaildir nnfolder utf-7
windresize gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
nntp gnus-cache shr-color textsec uni-scripts idna-mapping ucs-normalize
uni-confusable textsec-check network-stream url-cache mail-extr cl-print
test-test citar-org oc-csl oc-basic finder skeleton tramp-cache
time-stamp tramp-sh shortdoc d-emacs-icicles cus-start icicles
two-column icicles-mode dired+ image-file image-converter mb-depth+
mb-depth icicles-cmd2 icicles-cmd1 icicles-mcmd image-dired
image-dired-tags image-dired-external image-dired-util icicles-fn
icicles-var apropos-fn+var apropos icicles-opt ffap- fuzzy-match
icicles-face misearch multi-isearch vertico-directory dabbrev cape-char
isearch+ isearch-prop menu-bar+ bookmark+ bookmark+-key bookmark+-bmu
info+ fit-frame help-fns+ wid-edit+ bookmark+-lit pp+ bookmark+-1 vc-hg
vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view vc bug-reference
conf-mode markdown-mode eglot external-completion jsonrpc seq-25 ert
ewoc mhtml-mode css-mode-expansions css-mode smartparens-javascript
js-mode-expansions js c-ts-common citar-capf citar-embark citar
citar-file citar-cache citar-format mixed-pitch ol-eww ol-rmail ol-mhe
ol-irc ol-info ol-gnus nnselect ol-docview doc-view ol-bbdb ol-w3m
ol-doi org-link-doi dired-x smtpmail gnus-registry registry gnus-art
mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum gnus-group
gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source nnoo
gnus-spec gnus-win gnus-int gnus-range imap rfc2104 utf7 d-emacs-org
d-emacs-eww d-emacs-gnus d-emacs-emacs d-emacs-corfu d-emacs-doremi
d-emacs-cdlatex d-emacs-pdf-tools d-emacs-ext checkdoc vc-git
vc-dispatcher recentf tree-widget edit-server epa-file goto-addr
autoinsert completion elec-pair corfu-history delsel undo-tree desktop
frameset d-emacs-mode d-emacs-dfk d-emacs-stump d-emacs-dirs
d-emacs-bind d-emacs-xkb smartparens-c cc-mode-expansions cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs d-emacs-coords d-emacs-base avy-act eww vtable mule-util shr
pixel-fill kinsoku mm-url gnus nnheader range emms-idapi-browser
emms-idapi emms-idapi-musicbrainz emms-mpris emms-librefm-stream
emms-librefm-scrobbler emms-playlist-limit emms-i18n emms-history
emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks
emms-cue emms-mode-line-icon emms-browser sort emms-volume
emms-volume-sndioctl emms-volume-mixerctl emms-volume-pulse
emms-volume-amixer emms-playlist-sort emms-last-played emms-player-xine
emms-lyrics emms-streams emms-show-all emms-tag-editor emms-tag-tracktag
emms-mark emms-mode-line emms-info-native emms-info-native-spc
emms-info-native-mp3 emms-info-native-ogg emms-info-native-opus
emms-info-native-flac emms-info-native-vorbis bindat emms-info-exiftool
emms-info-tinytag emms-info-metaflac emms-info-opusinfo
emms-info-ogginfo emms-info-mp3info emms-player-vlc emms-player-mpv
emms-playing-time emms-player-mplayer emms-setup emms-player-mpd
emms-url emms-cache emms-info emms-later-do emms-playlist-mode
emms-source-playlist emms-source-file locate emms-player-simple emms
emms-compat empv back-button nav-flash smartrep rainbow-blocks
org-rainbow-tags dired-rainbow dired-hacks-utils dired-aux
rainbow-delimiters rainbow-mode modus-themes abyss-theme
yaml-mode-expansions yaml-mode julia-snail spinner pulse popup eldoc-box
flycheck ox-md org-modern math-delimiters add-tex-envs cdlatex reftex
reftex-loaddefs reftex-vars latex-extra preview smartparens-latex
latex-mode-expansions latex latex-flymake flymake tex-ispell tex-style
tex dbus texmathp auctex mentor url-scgi mentor-rpc mentor-files
mentor-data xml-rpc fancy-compilation eshell-vterm em-term esh-ext
esh-proc esh-opt esh-io esh-arg esh-module esh-module-loaddefs esh-util
vterm tramp trampver tramp-integration files-x tramp-message
tramp-compat tramp-loaddefs face-remap term disp-table ehelp
vterm-module term/xterm xterm unicode-fonts font-utils dynamic-fonts
ztree ztree-diff ztree-diff-model ztree-dir ztree-view ztree-protocol
ztree-util yasnippet elgrep async grep dedicated auto-dictionary
flyspell ispell all-the-icons-completion all-the-icons-dired
all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons go-translate
gt-text-utility gt-engine-echo gt-engine-libre gt-engine-chatgpt
gt-engine-youdao gt-engine-stardict gt-engine-deepl gt-engine-google-rpc
gt-engine-google gt-engine-bing gt-extension gt-faces gt-core plz
gt-httpx gptel-extensions gptel gptel-org gptel-openai tabgo tab-line
dired-quick-sort ls-lisp aggressive-indent visible-mark
org-noter-org-roam org-noter org-noter-djvu org-noter-nov org-noter-pdf
pdf-tools pdf-view jka-compr pdf-cache pdf-info tq pdf-util pdf-macs
image-mode exif org-noter-core ekg-import-subdirectories triples
org-roam-export use-package-ensure-system-package system-packages
consult-org-roam consult-org-roam-buffer org-ref org-ref-core openalex
request org-ref-glossary org-ref-bibtex smartparens-html
html-mode-expansions sgml-mode facemenu avy doi-utils url-http url-auth
url-gw nsm org-ref-utils org-ref-export citeproc citeproc-itemgetters
citeproc-cite citeproc-biblatex citeproc-bibtex ol-bibtex parse-time
citeproc-subbibs citeproc-sort citeproc-name citeproc-formatters
citeproc-proc citeproc-disamb citeproc-itemdata
citeproc-generic-elements citeproc-macro citeproc-choose citeproc-date
citeproc-number smartparens-rst smartparens-markdown rst compile
citeproc-context citeproc-prange citeproc-style citeproc-locale
citeproc-term citeproc-rt citeproc-lib citeproc-s queue ox-pandoc ht
ox-org ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util
rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex
ox-icalendar ox-html table ox-ascii ox-publish ox org-ref-misc-links
org-ref-label-link org-ref-ref-links org-ref-citation-links xref project
org-ref-bibliography-links hydra lv bibtex-completion parsebib
org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
org-roam-node org-roam-db emacsql-sqlite-builtin sqlite org-roam-utils
org-roam-compat org-roam org-capture emacsql-sqlite emacsql
emacsql-compiler org-brain picture org-agenda org-attach embark-org
smartparens-org the-org-mode-expansions org-element org-persist org-id
org-refile org-element-ast inline org ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-macro org-src sh-script smie treesit executable
ob-comint org-pcomplete org-list org-footnote org-faces org-entities
foldout noutline outline ob-emacs-lisp ob-core ob-eval org-cycle
org-table org-keys oc org-loaddefs cal-menu calendar cal-loaddefs ol
org-fold org-fold-core org-compat avl-tree generator org-version
org-macs biblio biblio-download biblio-dissemin biblio-ieee biblio-hal
biblio-dblp biblio-crossref biblio-arxiv timezone biblio-doi biblio-core
let-alist url-queue url-file ido bibtex iso8601 cape pass f s
password-store auth-source-pass kind-icon svg-lib svg dom xml
corfu-prescient vertico-prescient prescient char-fold windsize
corfu-terminal popon corfu consult-gh consult-gh-autoloads
compat-autoloads seq-autoloads embark-consult consult magit-bookmark
bookmark embark marginalia orderless magit-submodule magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func imenu magit-diff smerge-mode diff
diff-mode track-changes git-commit log-edit message sendmail yank-media
puny rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util
text-property-search time-date mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log magit-core magit-autorevert autorevert
filenotify magit-margin magit-transient magit-process with-editor shell
pcomplete comint ansi-osc server ansi-color magit-mode transient
benchmark magit-git magit-base magit-section format-spec cursor-sensor
crm persistent-soft list-utils pcache eieio-base savehist vertico-buffer
vertico-mouse vertico compat smartparens-config smartparens-text
smartparens loadhist dash expand-region text-mode-expansions
er-basic-expansions expand-region-core expand-region-custom
easy-kill-extras easy-kill-line-edge easy-kill-buffer easy-kill-to-char
easy-kill smart-mark buffer-move windmove anchored-transpose second-sel
doremi-frm frame-cmds palette eyedropper crosshairs col-highlight vline
hl-line+ hl-line advice misc-cmds rect faces+ thingatpt+ frame-fns avoid
hexrgb doremi-cmd cus-theme cus-edit pp wid-edit doremi info-colors
winner ring curry-compose rebinder gnus-dired finder-inf dired-du
find-dired edmacro auto-install cl ffap thingatpt dired dired-loaddefs
straight-autoloads straight quelpa-use-package quelpa mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr lisp-mnt help-fns radix-tree comp comp-cstr
cl-extra warnings comp-run comp-common kmacro functions rx use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core edebug debug
backtrace help-mode find-func sanityinc-tomorrow-bright-theme
color-theme-sanityinc-tomorrow color allout cus-load Icicles-autoloads
abyss-theme-autoloads aggressive-indent-autoloads
all-the-icons-completion-autoloads all-the-icons-dired-autoloads
auctex-cluttex-autoloads auto-dictionary-autoloads avy-act-autoloads
back-button-autoloads backup-walker-autoloads buffer-move-autoloads
cape-autoloads cdlatex-autoloads citar-embark-autoloads citar-autoloads
color-theme-sanityinc-tomorrow-autoloads consult-flycheck-autoloads
consult-lsp-autoloads consult-org-roam-autoloads
corfu-prescient-autoloads corfu-terminal-autoloads corfu-autoloads
d-emacs-base-autoloads d-emacs-bind-autoloads d-emacs-coords-autoloads
d-emacs-dfk-autoloads d-emacs-dirs-autoloads d-emacs-tri-autoloads
d-emacs-xkb-autoloads dedicated-autoloads default-text-scale-autoloads
diminish-autoloads dired-quick-sort-autoloads dired-rainbow-autoloads
dired-hacks-utils-autoloads doremi-autoloads dynamic-fonts-autoloads
easy-kill-extras-autoloads eldoc-box-autoloads elgrep-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
emms-autoloads empv-autoloads eshell-vterm-autoloads
expand-region-autoloads fancy-compilation-autoloads
flycheck-package-autoloads flycheck-autoloads forge-autoloads
closql-autoloads ghub-autoloads gnuplot-autoloads go-translate-autoloads
gptel-autoloads julia-snail-autoloads kind-icon-autoloads
latex-extra-autoloads auctex-autoloads tex-site
latex-pretty-symbols-autoloads lsp-julia-autoloads julia-mode-autoloads
lsp-ui-autoloads lsp-mode-autoloads marginalia-autoloads
mentor-autoloads mixed-pitch-autoloads modus-themes-autoloads
mood-line-autoloads nav-flash-autoloads orderless-autoloads
org-brain-autoloads org-modern-autoloads org-noter-autoloads
helm-autoloads helm-core-autoloads async-autoloads
org-rainbow-tags-autoloads org-ref-prettify-autoloads org-ref-autoloads
citeproc-autoloads htmlize-autoloads org-roam-bibtex-autoloads
bibtex-completion-autoloads biblio-autoloads biblio-core-autoloads
org-roam-autoloads emacsql-autoloads ox-pandoc-autoloads
package-build-autoloads derived package-lint-autoloads paredit-autoloads
parsebib-autoloads pass-autoloads f-autoloads
password-store-otp-autoloads password-store-autoloads
perspective-autoloads plz-autoloads popon-autoloads popup-autoloads
quelpa-autoloads rainbow-blocks-autoloads rainbow-mode-autoloads
smart-mark-autoloads smartparens-autoloads smartrep-autoloads
smudge-autoloads oauth2-autoloads speed-type-autoloads spinner-autoloads
sqlite3-autoloads string-inflection-autoloads svg-lib-autoloads
swiper-autoloads ivy-autoloads sx-autoloads markdown-mode-autoloads
tabgo-autoloads tablist-autoloads telega-autoloads
treemacs-all-the-icons-autoloads all-the-icons-autoloads
treemacs-icons-dired-autoloads treemacs-magit-autoloads magit-autoloads
pcase transient-autoloads magit-section-autoloads
treemacs-persp-autoloads persp-mode-autoloads
treemacs-projectile-autoloads projectile-autoloads
treemacs-tab-bar-autoloads treemacs-autoloads posframe-autoloads
avy-autoloads treepy-autoloads triples-autoloads try-autoloads
unicode-fonts-autoloads ucs-utils-autoloads font-utils-autoloads
persistent-soft-autoloads list-utils-autoloads pcache-autoloads
url-scgi-autoloads use-package-ensure-system-package-autoloads
system-packages-autoloads vertico-prescient-autoloads vertico-autoloads
prescient-autoloads visible-mark-autoloads visual-fill-column-autoloads
vterm-autoloads wfnames-autoloads windresize-autoloads
windsize-autoloads with-editor-autoloads xml-rpc-autoloads
yaml-autoloads yaml-mode-autoloads yasnippet-autoloads zotero-autoloads
oauth-autoloads info dash-autoloads ztree-autoloads package browse-url
xdg url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs icons
password-cache json subr-x map byte-opt gv bytecomp byte-compile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo gtk
x-toolkit xinput2 x multi-tty move-toolbar make-network-process
tty-child-frames native-compile emacs)

Memory information:
((conses 16 4637250 1858302) (symbols 48 157377 92) (strings 32 632762 173083)
 (string-bytes 1 19599231) (vectors 16 230134) (vector-slots 8 4045938 671061)
 (floats 8 2664 26292) (intervals 56 275713 9009) (buffers 992 393))