From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Setting truncate-lines to true for all .log files Date: Wed, 12 Jul 2006 01:32:25 +0200 Organization: Chalmers University of Technology, Sweden Message-ID: References: <1152646498.194749.92930@b28g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1152661240 9257 80.91.229.2 (11 Jul 2006 23:40:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Jul 2006 23:40:40 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 12 01:40:37 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 1G0Rq7-0000Xg-N2 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Jul 2006 01:40:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G0Rq7-0003ZN-8K for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Jul 2006 19:40:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeed.sunet.se!news01.sunet.se!129.16.222.141.MISMATCH!gide.ita.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: iota250.dd.chalmers.se Original-X-Trace: gide.ita.chalmers.se 1152660745 27376 129.16.117.150 (11 Jul 2006 23:32:25 GMT) Original-X-Complaints-To: usenet@gide.ita.chalmers.se Original-NNTP-Posting-Date: Tue, 11 Jul 2006 23:32:25 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:Ib/PRWUHb8QeRB+sP1m68pcHk2s= Original-Xref: shelby.stanford.edu gnu.emacs.help:140283 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:35908 Archived-At: "Ones Self" writes: > I'd like to have all *.log files have truncate-lines set to t, so > lines will not wrap. How would I set something like that up? > > When I open a .log file in emacs it goes into fundamental mode. I > could set it to go to a differerent mode using auto-mode-alist, but > which mode? Do I need to create a new mode for this? auto-mode-alist can contain any function, so you could get away with this: (defun log-mode () ;; You may want to call `fundamental-mode' or some other mode here (setq truncate-lines t)) (add-to-list 'auto-mode-alist '("\\.log\\'" . log-mode)) If you want to make a proper mode: (define-derived-mode log-mode fundamental-mode "Log" ;; The mode runs `log-mode-hook', so you could use that instead. (setq truncate-lines t)) auto-mode-alist as above. -- Johan Bockgård