From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Proud Newsgroups: gmane.emacs.help Subject: Re: Help Date: Wed, 20 Jan 2010 08:52:28 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <87d41i2sg7.fsf@Traian.DecebalComp> <87k4vpoaec.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1264056427 29495 80.91.229.12 (21 Jan 2010 06:47:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jan 2010 06:47:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 21 07:46:59 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NXqog-0007c8-RK for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jan 2010 07:46:55 +0100 Original-Received: from localhost ([127.0.0.1]:39394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXqiY-0003Tu-Dd for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jan 2010 01:40:34 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!y23g2000yqm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 85 Original-NNTP-Posting-Host: 70.212.131.151 Original-X-Trace: posting.google.com 1264006348 13826 127.0.0.1 (20 Jan 2010 16:52:28 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 20 Jan 2010 16:52:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y23g2000yqm.googlegroups.com; posting-host=70.212.131.151; posting-account=6UYrhgkAAABFowex4xt6G-olvLTEoxBV User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Linux; U; Android 2.1; en-us; Droid Build/ERE15) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:176255 X-Mailman-Approved-At: Thu, 21 Jan 2010 01:37:24 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71337 Archived-At: This is an especially good idea. I declared .emacs bankruptcy about two years ago, refactored for configuration and third-party imports into separate files, and never turned back. Another good tip is to put your Emacs configuration directory into version control---e.g., Git. If you're dilligent about keeping good comments in revision logs, you could just roll back to other dates when things go South. I declared general dot-file bankruptcy and put all my major ones in Git a while back. It makes life so simple between work, my laptop, and my desktop, too. Good luck! On Jan 10, 2:36=A0pm, Tim X wrote: > Cecil Westerhof writes: > > "Rhey, David" writes: > > >> There is a list of things that comes before this error, and a small su= ggestion > >> to run ??debug-init? after it. I?ve been working on this off and on fo= r awhile > >> now, but haven?t made any breakthroughs. Any help or insight would be = most > >> appreciated. > > > What I always find useful when debugging -and that is what you need to > > do- is commenting things out. > > I just would comment almost everything out and then start Emacs. If it > > goes alright, there is no problem with that. Then uncomment something, > > etc. When you know which code gives the problem, it is easier to solve. > > And if you can not solve it, you can 'exactly' tell what the problem is > > and it is easier for the people here to solve it. > > When you have an error in a .emacs file, especially if its a very large > one, I find the following useful. > > 1. Run with --debug-init. This will provide a backtrace which is often > enough to find the offending line. > > 2. If that doesn't help, a 'binary search' approach is often helpful. > Rather than commenting out all the lines, put a couple of message lines > in. Start with a line at around half way in the file i.e. > > (Message "Got to checkpoint 1") > > The error =A0will either be in the first half or the second half. So, nex= t > time you start emacs, check the messages buffer. If your message is in > there, you know your error is in the second half of the file, otherwise, > its in the first half. > > Once you have narrowed it down to which half, put another message > halfway in that half i.e. > > (message "Got to checkpoint 2) > > Keep repeating the process until you narrow down to the command with the > error. > > Another thing I do to make management of my .emacs easier is that I > break of related functionality into its own file. I put all these files > into a directory and add that directory to the emacs load-path. Each > file ends with a 'provides' line. I then just have 'require' lines in my > .emacs. For example, I have all my org mode stuff in a file called > tx-org.el. The last line of that file is > > (provide 'tx-org) > > In my .emacs I have a couple of lines at the top which set my private > elisp directories and then I have something like > > (require 'tx-org) > > I find this helps prevent my .emacs from becoming to large and clutterd > and I can add/remove related config settings just by > commenting/uncommenting one line in my .emacs. Another nice side effect > is that when I do have an error and I run debug-init, it usually clearly > indicates which of my config files the error is in, making it quick to > track down. > > Tim > > -- > tcross (at) rapttech dot com dot au