From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.help Subject: Critique these snippets from my .emacs file Date: Sun, 17 Jan 2010 13:21:41 -0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263764541 7468 80.91.229.12 (17 Jan 2010 21:42:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jan 2010 21:42:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 17 22:42:14 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 1NWcsu-00037N-NF for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jan 2010 22:42:13 +0100 Original-Received: from localhost ([127.0.0.1]:57090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWcsv-00007Q-LN for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jan 2010 16:42:13 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.glorb.com!news2.glorb.com!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 17 Jan 2010 15:21:42 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) Cancel-Lock: sha1:vB/mhN4k036yHchsT/wdchaq/pc= Original-Lines: 47 Original-X-Trace: sv3-5Oe3iT/NU0Kou97t1+dpT7qn1Oodv5vcX8uf3a9VBQ0pSiLhuTkEf4TvOmCqRIOR3EeKbbtsaWddM15!eob7j+BTkdMSjSXS0DTJrBCUvfN4Zzo8EBr+zxjJvWwo0Df/8bUnNT0FxF5LD+AhhkbQnf9pE7La!EZMsPbStRPXpeHz7j9+/svCnVqYGR77v2NKRnZq++xO6neSe1eD9mvP366cFgGkSoN/fPI+jag== Original-X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: news.stanford.edu gnu.emacs.help:176211 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:71282 Archived-At: I was hoping that some of the local experts might like to offer some critiques of some bits of my .emacs file that I suspect might be accomplishable in better or more standard ways. (global-set-key [(control m)] 'newline-and-indent) I've had this first bit just about since I started with Emacs. It's hard to believe that anyone at all would use C-j for this, as the Emacs manual seems to suggest. It's only in text-mode that it occasionally gives me unwanted indentation. (defadvice open-line (around vi-style-open-line activate) "Make open-line behave more like vi." (beginning-of-line) ad-do-it (indent-according-to-mode)) This snippet is also of pretty ancient vintage. It used to be its own function, but I recently recast it as advice. It also occasionally gives me unwanted indentation, typically in text-mode. (global-set-key [(control x) (control o)] 'other-window-delete-rest) (defun other-window-delete-rest (arg) "Goes to the next window with other-window, then makes that window the only visible window. With a prefix argument, kills the current buffer first." (interactive "P") (if arg (kill-buffer nil)) (other-window 1) (delete-other-windows)) This one has been so useful it's hard to believe it's not built into Emacs somewhere. I only recently discovered C-x 4 0, which does part of the job that this command does, but I think this arrangement is better overall. (defvar recenter-fraction 0.33 "The recenter-proportionally advice will recenter the screen by putting the current line this far down the window.") (defadvice recenter (before recenter-proportionally activate) (or (ad-get-arg 0) (ad-set-arg 0 (truncate (* recenter-fraction (window-body-height)))))) Pretty self-explanatory. It generally seems to be more convenient for me to see about twice as much below the current line as above.