From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Peter Lee Newsgroups: gmane.emacs.help Subject: Re: simple editor required Date: Tue, 03 Jun 2003 15:06:27 GMT Organization: SBC http://yahoo.sbc.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <1K1Da.3886$7E.44637@news-server.bigpond.net.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1054653118 21845 80.91.224.249 (3 Jun 2003 15:11:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2003 15:11:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 03 17:11:54 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19NDS5-0005fr-00 for ; Tue, 03 Jun 2003 17:11:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19NDQi-0001ZC-S5 for gnu-help-gnu-emacs@m.gmane.org; Tue, 03 Jun 2003 11:10:28 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr12.news.prodigy.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:O0SOqjc8sBo0E2/kqOcts6GWmEY= Original-Lines: 58 Original-NNTP-Posting-Host: 216.62.199.3 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr12.news.prodigy.com 1054652786 ST000 216.62.199.3 (Tue, 03 Jun 2003 11:06:26 EDT) Original-NNTP-Posting-Date: Tue, 03 Jun 2003 11:06:26 EDT X-UserInfo1: SCSYQN_@O@RYB\\YQCHN_TTDFRYB@GXLN@GZ_GYO^BTBTSUBYFWEAE[YJLYPIWKHTFCMZKVMB^[Z^DOBRVVMOSPFHNSYXVDIE@X\BUC@GTSX@DL^GKFFHQCCE\G[JJBMYDYIJCZM@AY]GNGPJD]YNNW\GSX^GSCKHA[]@CCB\[@LATPD\L@J\\PF]VR[QPJN Original-Xref: shelby.stanford.edu gnu.emacs.help:114044 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10538 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10538 >>>> On Tue, 03 Jun 2003 13:51:57 GMT, "Paul Edwards" said: Paul> ... didn't stop this auto-file-association from happening? Paul> I basically don't want emacs to do any junk like that, I'm Paul> not interested in its assumptions, I'm after basic editting Paul> functions, rather than by default being launched into its Paul> weird ideas of what C code should look like (which is Paul> probably a style used by less than 10% of C programmers). There are several styles provided by emacs (see c-default-style and c-set-style). You can also create your own style, or you can simply change an existing style to suit your needs (which is what I do). (defun my-c-mode-common-hook () (turn-on-font-lock) (c-set-offset 'substatement-open 0) (c-set-offset 'arglist-intro 1) (c-set-offset 'defun-open 4) (c-set-offset 'defun-block-intro 0) (c-set-offset 'statement 0) (c-set-offset 'substatement-open 4) (c-set-offset 'statement-block-intro 0) (c-set-offset 'substatement 4) (c-set-offset 'statement-cont 4) (c-set-offset 'label -4) (c-set-offset 'topmost-intro-cont 4) (c-set-offset 'brace-list-intro 0) (c-set-offset 'class-open 4) (c-set-offset 'class-close 4) (c-set-offset 'topmost-intro '-) (c-set-offset 'brace-list-open 4) (c-set-offset 'access-label '--) (c-set-offset 'func-decl-cont 0) (c-set-offset 'case-label 0) (c-set-offset 'statement-case-intro 4) (c-set-offset 'statement-case-open 4) (c-set-offset 'inline-open '+) (c-toggle-auto-hungry-state 1) (local-set-key [?\C-c ?\C-i] 'c-includes-current-file) (define-abbrev local-abbrev-table "ifx" "" 'my-skeleton-c-if) (define-abbrev local-abbrev-table "forx" "" 'my-skeleton-c-for) (define-abbrev local-abbrev-table "whilex" "" 'my-skeleton-c-while) (define-abbrev local-abbrev-table "switchx" "" 'my-skeleton-c-switch)) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) If you really do want text mode for c files then specify it with the auto-mode-alist: (setq auto-mode-alist (append '(("\\.c$" . text-mode) ("\\.cc$" . text-mode) ("\\.C$" . text-mode) ("\\.CC$" . text-mode) ("\\.h$" . text-mode) ("\\.H$" . text-mode)) auto-mode-alist))