From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: How to quit? Date: Wed, 25 Feb 2015 11:54:54 -0700 Message-ID: <20150225112858986754644@bob.proulx.com> References: <87y4nm3svs.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1424890512 18351 80.91.229.3 (25 Feb 2015 18:55:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Feb 2015 18:55:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 25 19:55:11 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YQh70-0004Qg-S7 for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Feb 2015 19:55:11 +0100 Original-Received: from localhost ([::1]:55954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQh70-0002pK-DP for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Feb 2015 13:55:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQh6p-0002p6-EC for help-gnu-emacs@gnu.org; Wed, 25 Feb 2015 13:55:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQh6m-0001W8-6F for help-gnu-emacs@gnu.org; Wed, 25 Feb 2015 13:54:59 -0500 Original-Received: from joseki.proulx.com ([216.17.153.58]:37851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQh6l-0001W1-Uw for help-gnu-emacs@gnu.org; Wed, 25 Feb 2015 13:54:56 -0500 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id D7FBD21832 for ; Wed, 25 Feb 2015 11:54:54 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id C9B502DC46; Wed, 25 Feb 2015 11:54:54 -0700 (MST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87y4nm3svs.fsf@wmi.amu.edu.pl> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102892 Archived-At: Marcin Borkowski wrote: > OK, so I have a problem, and it doesn't show up when I do emacs -Q. So > I take a deep breath and bisect my 900-line init.el... > > In LaTeX, however, when I have some weird problem, I can put \endinput > in a file, and everything past that is ignored. Is there anything like > that in Elisp? > > It just occured to me that (debug) /might/ work, and so might > (keyboard-quit). Is this a good idea? Are there any others? The way I do this myself is to copy the file off to a safe place as a backup. Then use two copies of emacs. In one copy I chop the file up into the bisections. The other copy I start and stop repeatedly letting it load the init file possibly with or without --debug-init to debug the file. By using two emacs processes I can keep one open with the init file being chopped up. That one I can easily work through the process like this following. Note that I disable transient mark mode and line-move-visual as evil. C-x h mark-whole-buffer M-= count-words-region ...say the buffer has 120 lines... C-u 60 C-n C-w kill-region C-x C-s save-buffer ...test... problem in remaining or removed section?... If in the remaining section then cut it in half again. If in the removed section then undo the region kill and then kill the other half save and test again. Continue until you have converged on the problem. Once I get things reduced to a single screen I can usually see the problem by eye and inspection. Good luck! Bob P.S. There are many ways to determine the number of lines in the file to start the bisection. There is M-x what-line. The line number has been added to the mode line in recent versions so simply jump to the bottom and look in the modeline. Other ways. There are many ways to cut the file in half. If you don't like moving by lines or have line-move-visual enabled so that next-line doesn't actually move by lines then there is M-g g goto-line to jump there directly. Also the movement commands M-> and M-< leave the mark behind. Use C-x C-x to view the extent of the region between mark and point. The M-> end-of-buffer and M-< beginning-of-buffer commands have an odd additional behavior. With numeric arg N, put point N/10 of the way from the beginning. If the buffer is narrowed, this command uses the beginning of the accessible part of the buffer. Therefore running M-< C-u 5 M-> will take you to the middle of the buffer.