From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: configuring emacs as a programmer's editor Date: Fri, 30 Jun 2006 09:03:02 +0200 Organization: Organization?!? Message-ID: <85y7vfi0rd.fsf@lola.goethe.zz> References: <1151627894.208462.326680@m73g2000cwd.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1151653358 19007 80.91.229.2 (30 Jun 2006 07:42:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 30 Jun 2006 07:42:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 30 09:42:36 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FwDe5-0006VJ-0L for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jun 2006 09:42:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FwDe4-0005qy-7z for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jun 2006 03:42:32 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!kanaga.switch.ch!switch.ch!news-fra1.dfn.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!news.arcor.de!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:hYnobrSxVsZDw8hTc0d37JgVfzE= Original-Lines: 54 Original-NNTP-Posting-Date: 30 Jun 2006 09:03:39 MEST Original-NNTP-Posting-Host: eb622c30.newsread4.arcor-online.net Original-X-Trace: DXC=fU7O>WC; jPoIeeCiY5g2Vc:ejgIfPPlddjW\KbG]kaMhLL]:kiR8f=ong; VK:o_86c1_LiI6ENVam3>5MOK`O=Rkj4kP3U_eY2l Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: shelby.stanford.edu gnu.emacs.help:140123 Original-To: help-gnu-emacs@gnu.org 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:35748 Archived-At: "Ted" writes: > OK, I have used emacs as just a clone of Notepad for quite a while. I > know that is under-using it, but I found configuring it to be more > useful to me a bit onerous. I find the emacs documentation a bit dense > on one side, and short of the details and examples I need on the other. > > I have a basic .emacs file, appended below, that seems like it > should support most of the programming languages I use. I > constructed it by copying and pasting portions of .emacs files I > found published on the web. That is the worst thing one can possibly do. You'll get a hotch potch of what various people with various skills considered to be a good idea for various versions of Emacs. Instead, start from an empty .emacs and add things you need by referring to the manual and/or using M-x customize RET. The Emacs manual also contains a section about configuration. > (setq auto-mode-alist > '( > ("\\.bashrc\\'" . sh-mode) VERY VERY VERY bad idea: you destroy all of Emacs' built-in knowledge about types. Instead you should add only those things that you need specifically to the front of auto-mode-alist. Probably even nothing is necessary here. > (delete-frame) > (if (y-or-n-p "Are you sure you want to quit? ") > (save-buffers-kill-emacs) > (message "Quit aborted.")))) > (defun paren-match () > "Jumps to the paren matching the one under point, > and does nothing if there isn't one." > (interactive) > (cond > ((looking-at "[({[]") (forward-sexp 1) (backward-char)) > ((looking-at "[]})]") (forward-char) (backward-sexp 1)) > (t (message "Could not find matching paren."))) ) > > ;; pretty-print hashes: > (if (fboundp 'maphash) > (defun pp-hash (H) > (let (s) > (maphash > (lambda (K V) > (setq s (concat s (format "%S => \n%s" K (pp V))))) H) s))) > -- David Kastrup, Kriemhildstr. 15, 44793 Bochum