From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Artur Hefczyc Newsgroups: gmane.emacs.help Subject: Re: Emacs newbie - Syntax Highlighting and Indentation Date: Fri, 14 Nov 2003 20:20:59 +0200 Organization: Aster City Net Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87n0ay24ms.fsf@141-moc-9.acn.waw.pl> References: Reply-To: DONTkobit@SPAMplusnet.MEpl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068834715 8332 80.91.224.253 (14 Nov 2003 18:31:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2003 18:31:55 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 14 19:31:52 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKijY-000563-00 for ; Fri, 14 Nov 2003 19:31:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AKjfl-0007OQ-6W for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Nov 2003 14:32:01 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.astercity.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-NNTP-Posting-Host: 212.76.54.141 Original-X-Trace: foka.aster.pl 1068834062 62300 212.76.54.141 (14 Nov 2003 18:21:02 GMT) Original-X-Complaints-To: abuse@astercity.net Original-NNTP-Posting-Date: Fri, 14 Nov 2003 18:21:02 +0000 (UTC) X-Tech-Contact: usenet@astercity.net X-Server-Info: http://www.astercity.net/news/ User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:zMWzextp1rP5ueZ/Ds1jfnBLnLw= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEWZnZ3Iy9WTkI0NBA/H oYr09Ph6ZFJAKRng2dewemz3jcCRAAACR0lEQVR4nFWSvWvjQBDF1+a42jJyUKkTwcnVLtzGZrjL ljki2PJsi3HUHRi0tSGCrc2isP/tvVn5SyNceH779r0ZSZGnk59bvtVhIaVCRd3jfH/r7xc90LUn 2lvboGftVQBFzV3d6Y5tYwWfBVAEDoEhsRZnrb0CW5Ej+pKOHQB6dZnT0ljaWBfw2gOxxw/0Yp6g st9yNCZdXhVEajWN9zRsBZwlSmq6iwbcm5xBotRI7ZaLy4j20BOcL4rvcYKGA2z4sLxcNS7m8W4Z FKobKIriIKAOmgH39qpQAhYNttnVAIuBYmEFhBC6AYhxayINwPYGxjsJFbyQbn9nPpat14GiBFu4 XYX8TQCABx/uQD7HBB6nEddWL/HtqhxAzUMQgLkDV60xqeYI8p8hxLBce9641jlHACrPi0eSTHj9 vquOLjOexLpQYwAJFYLXAO6hIjHPC1H0Y5A+vahvXz4C7LdA0D5uOCmAEOJVGJGlp/GwX03SJ76A OWxlbLFaJelTo6NDBBQJ80mN0l916B0K3noxlpXwFu/eexWP7/+l5DV5j0G7k9gFlcsGt7N3DK41 ZKuUSNQK/W0xK41MoTWFVZIgNj7Dhp9LqTQOXqHvQAB420rfvOEPFpUlxwQ/APtsIik/cVf3Q77x xLnjWv0tz2VS7Cm25ZkotHpF+U7rTRRk2TEzqrzV5zpJzlc5dw/MzPUK9AeKt605C5DnHvzhUS9o TTlQPPBHD0pXHodgIyauLc0QTHnk2iMEpWnvU5kJf8wMEslo5j+pJm2vs6mv0wAAAABJRU5ErkJg gg== Original-Xref: shelby.stanford.edu gnu.emacs.help:118264 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.emacs.help:14205 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14205 David Rasmussen writes: > 1) How do I enable syntax highlighting by default, for any type of file / > extension / mode that supports it? I have enabled it in the Options menu, and > saved my options. But isn't there a non-menu-way of doing this, so I can get > to learn and understand how to configure emacs myself? Right way to customize emacs is to edit .emacs file in your home directory. It is easy to find on Unix like systems but windows have 'home' directory in many different locations. So I suggest to look for your .emacs file on HDD. It should be there, because you saved your settings. It contains elisp code in most cases setting many different variables. Here is my .emacs file in use on both systems - Windows and Linux: http://wttools.sourceforge.net/emacs-stuff/emacs.html It is rather big file but don't panic, you don't need to start with all these settings. Many of them are commented in this file. > 2) When I edit a java file, the Java major mode i automatically loaded. But when > I press TAB at the beginning of a new line, i get an indentation of 4 > spaces. How do I alter this to 2 spaces instead? Or any other number of > spaces? What if I want to get a tab character instead of spaces, when > indenting (I really don't, but I would like to know)? The shortest answer to your question is: Put to your .emacs file following code: (setq c-basic-offset 2) Other setting you might find useful for Java coding are: (setq tab-width 4 indent-tabs-mode nil) However for Java coding I recommend JDEE package for emacs. I have been using it for 3 years and I am very satisfied with it. You can find more information about (installation, setup and use) it in article I work on at following address: http://wttools.sourceforge.net/emacs-stuff/emacsandjdee.html If you need more info just ask. Artur -- Artur Hefczyc, Open Source Developer: http://www.geotools.org/ http://generguide.sourceforge.net/ http://wttools.sourceforge.net/ http://maven-plugins.sourceforge.net/