* Setting truncate-lines to true for all .log files
@ 2006-07-11 19:35 Ones Self
2006-07-11 19:55 ` Peter Dyballa
2006-07-11 23:32 ` Johan Bockgård
0 siblings, 2 replies; 4+ messages in thread
From: Ones Self @ 2006-07-11 19:35 UTC (permalink / raw)
Hi,
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?
Is there already a good mode dedicated to text
log files in emacs (I couldn't find one)?
Thanks for all your help
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Setting truncate-lines to true for all .log files
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
1 sibling, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2006-07-11 19:55 UTC (permalink / raw)
Cc: emacs mailing list
Am 11.07.2006 um 21:35 schrieb Ones Self:
> 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?
Text-mode? Sh-mode?
I never could decide which so I just customised
'(truncate-lines nil)
--
Greetings
Pete
Experience is what you get when you don't get what you want.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Setting truncate-lines to true for all .log files
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
2006-07-12 22:45 ` Ones Self
1 sibling, 1 reply; 4+ messages in thread
From: Johan Bockgård @ 2006-07-11 23:32 UTC (permalink / raw)
"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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Setting truncate-lines to true for all .log files
2006-07-11 23:32 ` Johan Bockgård
@ 2006-07-12 22:45 ` Ones Self
0 siblings, 0 replies; 4+ messages in thread
From: Ones Self @ 2006-07-12 22:45 UTC (permalink / raw)
Thank you very much for your help,
Your solution is both elegant, and does exactly what
I need.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-12 22:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2006-07-12 22:45 ` Ones Self
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).