;; -*- lexical-binding: t; -*-
;; Emacs early initialization

;; Fix upgrading in the built-in org-mode

(if (featurep 'org) (unload-feature 'org))

;; Initialise installed packages at this early stage, by using the
;; available cache.  I had tried a setup with this set to nil in the
;; early-init.el, but (i) it ended up being slower and (ii) various
;; package commands, like `describe-package', did not have an index of
;; packages to work with, requiring a `package-refresh-contents'.

;; [[file:../plrjorg/config/emacs/20240520T091920--base__abbrev_fido_icomplete_ido_earlyinit_time.org::#h:7FC8277B-4146-468A-BA77-0E6DCA672D88][Early initialization:2]]
(setq
 package-enable-at-startup t
 )
;; Early initialization:2 ends here

;; Freeing up Alt (A- ) key bindings
;; :PROPERTIES:
;; :CUSTOM_ID: h:5BBB83C9-0775-4AC5-8439-19608AB59D41
;; :END:

;; Since I live in Org-mode, I want commands to be easily accessible. The below releases the Alt keybindings from UTF-8 symbols, which are accessible in other ways. In the =org-mode= configuration I will take advantage of this.


;; [[file:../plrjorg/config/emacs/20240520T091920--base__abbrev_fido_icomplete_ido_earlyinit_time.org::#h:5BBB83C9-0775-4AC5-8439-19608AB59D41][Freeing up Alt (A- ) key bindings:1]]
;; This is needed to unbind Alt key mappings to UTF
;;   symbols as an abbreviation for C-x 8 map in
;;   iso-transl.el
;; To be more clear, makes it so that one can remap
;;   the entire Alt keybinding space to whatever.
;;   iso-transl.el loads exceedingly early in recent
;;   Emacs versions. It takes ownership of the Alt
;;   map and the usual keymap tools will not change
;;   iso-transl.el assignments.
;; https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg02500.html
;; Thanks to Eli Zaratskii, Gregory Heytings, and
;;   especially Mark Bestley for the solution!

(dolist (transl-char iso-transl-char-map)
  (let ((vec (vconcat (car transl-char))))
    (aset vec 0 (logior (aref vec 0) ?\A-\^@))
    (define-key key-translation-map vec nil))
  )
;; Freeing up Alt (A- ) key bindings:1 ends here

(setq
 frame-resize-pixelwise t
 frame-inhibit-implied-resize 'force
 frame-title-format '("%b")
 ring-bell-function 'ignore
 use-dialog-box nil
 use-file-dialog nil
 use-short-answers t
 ;; inhibit-splash-screen nil
 ;; inhibit-startup-screen nil
 inhibit-x-resources t
 ;; inhibit-startup-echo-area-message user-login-name ; read the docstring
 ;; inhibit-startup-buffer-menu nil
 )

(provide 'early-init)

;;; early-init.el ends here