From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: help with setq for specific file types.... Date: Mon, 30 Sep 2002 16:22:42 +0200 Organization: Olymp Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1033390585 29729 127.0.0.1 (30 Sep 2002 12:56:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 30 Sep 2002 12:56:25 +0000 (UTC) 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 17w064-0007jM-00 for ; Mon, 30 Sep 2002 14:56:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17w06F-0007WX-00; Mon, 30 Sep 2002 08:56:35 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dialin-145-254-204-062.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: dialin-145-254-204-062.arcor-ip.net (145.254.204.62) Original-X-Trace: fu-berlin.de 1033389713 12230684 145.254.204.62 (16 [87814]) X-Orig-Path: hermes!nobody X-Operating-System: GNU/Linux, built from scratch: http://www.linuxfromscratch.org/ X-Attribution: os X-Face: "HgH2sgK|bfH$;PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) Cancel-Lock: sha1:iT4EPrPSwSncM8jA2D4/Vpux+Kk= Original-Xref: nntp.stanford.edu gnu.emacs.help:105534 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2078 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2078 twylie writes: [...] > 1. I want to be able to do a setq for specific file types. For example, > any file that ends with .html I would like to use (setq-default > line-spacing 12). I see how to add file suffixes to alist -- but not how > to set setq values. Can someone help me here? The way you explain it does not make sense for me at all. If you do what you explain here literally, _all_ buffers would change their line-spacing, whenever you open a file of a different type. I presume that you want to have, say, all html buffers with a line spacing of 12 and all Elisp buffers with a line spacing of 4. The Emacsian way to do such things is via the corresponding major modes and via hooks. See the section about hooks in the Emacs manual: `C-h i d m emacs RET i hook RET'. Or with the mouse: Help ==> Read the Emacs manual ==> Customization ==> Variables ==> Hooks. For example to get a line spacing of four in every Elisp buffer, you could add this to your .emacs: (add-hook 'emacs-lisp-mode-hook (lambda () (setq line-spacing 4))) > 2. Also, I would like to add color syntax for anything between quotes > (") in text mode. Uuh, I have not yet mastered the arcane mysteries of the ways of the mighty Font Lock. But the following seems to work for me: (add-hook 'text-mode-hook (lambda () (modify-syntax-entry ?\" "|" text-mode-syntax-table) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(nil nil t)))) -- Oliver -- 9 Vendémiaire an 211 de la Révolution Liberté, Egalité, Fraternité!