init.el
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 25 Dec 2023 20:15:49 +0200
changeset 1772 d97be992a1f9
parent 1721 f9fb82deb6b7
permissions -rw-r--r--
Introduced Org state FAILED.

;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78 -*-
;;
;; For load order see README.

(load "~/.emacs.d/.emacs-defs")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "turn on debugger/profiler during loading")

(when my-profiler-enabled
  (profiler-start 'cpu))

(defun my-debug (mode)
  "With any prefix enables entering into a debuger and shows the
backtrace when problems occur. Also activates entering into
debugger on C-g.

With double prefix (or any number) additonally enable debugging
on events and signals.

Without prefix (or `nil' argument) disables entering into the
debugger."
  (interactive "P")
  (let ( (lvl1 (not (not mode)))
         (lvl2 (or (equal mode '(16)) (numberp mode))) )
    (setq debug-on-error lvl1)
    ;; Get trace when press C-g.
    (setq debug-on-quit lvl1)
    (setq debug-on-event lvl2)
    (setq debug-on-signal lvl2)
    (cond
     (lvl2 (message "Debugging on quit/event/signal..."))
     (lvl1 (message "Debugging on quit..."))
     (t (message "Debugging disabled...")))))

;; Instead of launching Emacs with "--debug-init" I enable entering into
;; debugger on error & on C-g.
(my-debug t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "load-path")

(load "~/.emacs.d/.emacs-defs")

(load custom-file t)
(load my-lisp-autogen t)
(load my-lisp-auth t)
(load my-lisp-pre)

(my-lisp--load-usr-home)

;; (setq package-enable-at-startup t)
(when (fboundp 'package-initialize)
  (package-initialize))

(load my-lisp-autoload t)
(load my-lisp-dotemacs t)
(load my-lisp-post t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "turn off debugger/profiler after loading")

(my-debug nil)

(when my-profiler-enabled
  (profiler-report)
  (profiler-stop))