all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
Subject: Re: Setting truncate-lines to true for all .log files
Date: Wed, 12 Jul 2006 01:32:25 +0200	[thread overview]
Message-ID: <yoij4pxnpvjq.fsf@iota250.dd.chalmers.se> (raw)
In-Reply-To: 1152646498.194749.92930@b28g2000cwb.googlegroups.com

"Ones Self" <oneself@gmail.com> 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

  parent reply	other threads:[~2006-07-11 23:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-11 19:35 Setting truncate-lines to true for all .log files Ones Self
2006-07-11 19:55 ` Peter Dyballa
2006-07-11 23:32 ` Johan Bockgård [this message]
2006-07-12 22:45   ` Ones Self

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yoij4pxnpvjq.fsf@iota250.dd.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.