init.el
changeset 1711 621215ccccf9
parent 1688 0bab53c47567
child 1712 5ed78a45b299
equal deleted inserted replaced
1710:03f26aaabbfa 1711:621215ccccf9
     3 ;; Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008-2010.
     3 ;; Written by Oleksandr Gavenko <gavenkoa@gmail.com>, 2008-2010.
     4 ;;
     4 ;;
     5 ;; This file placed in public domain.
     5 ;; This file placed in public domain.
     6 ;;
     6 ;;
     7 ;; For load order see README.
     7 ;; For load order see README.
       
     8 
       
     9 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
    10 (message "turn on debugger during loading")
       
    11 
       
    12 (defun my-debug (mode)
       
    13   "With any prefix enables entering into a debuger and shows the
       
    14 backtrace when problems occur. Also activates entering into
       
    15 debugger on C-g.
       
    16 
       
    17 With double prefix (or any number) additonally enable debugging
       
    18 on events and signals.
       
    19 
       
    20 Without prefix (or `nil' argument) disables entering into the
       
    21 debugger."
       
    22   (interactive "P")
       
    23   (let ( (lvl1 (not (not mode)))
       
    24          (lvl2 (or (equal mode '(16)) (numberp mode))) )
       
    25     (setq debug-on-error lvl1)
       
    26     ;; Get trace when press C-g.
       
    27     (setq debug-on-quit lvl1)
       
    28     (setq debug-on-event lvl2)
       
    29     (setq debug-on-signal lvl2)
       
    30     (cond
       
    31      (lvl2 (message "Debugging on quit/event/signal..."))
       
    32      (lvl1 (message "Debugging on quit..."))
       
    33      (t (message "Debugging disabled...")))))
       
    34 
       
    35 ;; Instead of launching Emacs with "--debug-init" I enable entering into
       
    36 ;; debugger on error & on C-g.
       
    37 (my-debug t)
     8 
    38 
     9 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    10 (message "load-path")
    40 (message "load-path")
    11 
    41 
    12 (load "~/.emacs.d/.emacs-defs")
    42 (load "~/.emacs.d/.emacs-defs")
    30 (load my-lisp-post t)
    60 (load my-lisp-post t)
    31 
    61 
    32 (when my-profiler-enabled
    62 (when my-profiler-enabled
    33   (profiler-report)
    63   (profiler-report)
    34   (profiler-stop))
    64   (profiler-stop))
       
    65 
       
    66 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
    67 (message "turn off debugger after loading")
       
    68 
       
    69 (my-debug nil)