init.el
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 10 Dec 2022 18:34:57 +0200
changeset 1765 5cabf87dd450
parent 1721 f9fb82deb6b7
permissions -rw-r--r--
Fixed M-x shell in Mingw Emacs, Bash "-i" is not supported in dumb Emacs terminal. bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell tput: unknown terminal "emacs"

;; -*- 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))