home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / emacs / help / 5475 < prev    next >
Encoding:
Text File  |  1993-01-23  |  2.4 KB  |  68 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!mcsun!sunic!kth.se!news.kth.se!LEVITTE
  3. From: LEVITTE@e.kth.se (Richard Levitte)
  4. Subject: Re: debugging .emacs
  5. In-Reply-To: nickel@cs.tu-berlin.de's message of 22 Jan 1993 19:16:29 GMT
  6. Message-ID: <LEVITTE.93Jan23174528@elin.e.kth.se>
  7. Sender: usenet@kth.se (Usenet)
  8. Nntp-Posting-Host: elin.e.kth.se
  9. Organization: Department of TeleTransmission Theory
  10. References: <PSHANNON.93Jan20220406@iapetus.cv.nrao.edu>
  11.     <NICKEL.93Jan22201627@tempest.cs.tu-berlin.de>
  12. Date: Sat, 23 Jan 1993 16:45:28 GMT
  13. Lines: 53
  14.  
  15. >>>>> On 22 Jan 1993 19:16:29 GMT, nickel@cs.tu-berlin.de (Juergen Nickelsen) said:
  16.  
  17. JN> Unfortunately debugging .emacs is not very intuitive. Here is what I
  18. JN> do: 
  19.  
  20. JN> The code in my .emacs is embedded in a let contruct which sets
  21. JN> debug-on-error to t:
  22.  
  23. JN>   (let ((debug-on-error t))
  24.  
  25. JN>     ;; startup code
  26.  
  27. JN>     )
  28.  
  29. JN> This way Emacs doesn't behave different on error in the .emacs when
  30. JN> starting up (i.e. only the non-descriptive message "Error in init
  31. JN> file" appears), but I can start Emacs with the -q switch ("Do not load
  32. JN> your Emacs init file `~/.emacs'"), then do a (load-file ".emacs").
  33.  
  34. It is possible to make that error message a little more descriptive
  35. with the following patch on startup.el:
  36.  
  37. *** ed:[orig.lisp]startup.el
  38. --- ed:[new.lisp]startup.el
  39. **************
  40. *** 124,130
  41.                ;; Don't you dare turn this off for anyone
  42.                ;; except yourself.
  43.                (load "default" t t)))))
  44. !       (error (message "Error in init file")))
  45.       (if (get-buffer "*scratch*")
  46.       (save-excursion
  47.         (set-buffer "*scratch*")
  48. --- 124,130 -----
  49.                ;; Don't you dare turn this off for anyone
  50.                ;; except yourself.
  51.                (load "default" t t)))))
  52. !       (error (message (format "Error in init file: %s" error))))
  53.       (if (get-buffer "*scratch*")
  54.       (save-excursion
  55.         (set-buffer "*scratch*")
  56.  
  57.  
  58. The message can be a little cryptic, but it helps to get the message:
  59. "Error in init file: (void-variable foo)"
  60.  
  61. --
  62. !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
  63. ! Richard Levitte, VMS GNU Emacs hacker   ! tel: int+46-8-18 30 99            !
  64. ! Sulv"agen 57, II                        ! fax: none for the moment          !
  65. ! S-126 40 H"agersten                     ! Internet: levitte@e.kth.se        !
  66. ! SWEDEN                                  !                                   !
  67. !-----------------------------------------------------------------------------!
  68.