unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* inappropriate use of nroff-mode leads to grief
@ 2002-09-03 19:05 Robert Marshall
  2002-09-03 21:44 ` Kai Großjohann
  2002-09-04 17:41 ` Stefan Monnier <foo@acm.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Robert Marshall @ 2002-09-03 19:05 UTC (permalink / raw)


I use logrotate to compress /var/log files so these are saved as (e.g)
syslog.1.gz

When I edit them, I have global-font-lock mode set but
font-lock-maximum-size is set to (the default) 256000 and the current
buffer is 9000000 but font-lock-mode still appears to be on and
whenever I try to scroll around the log file it's trying to parse it
as nroff - not a great success.

Takes forever to page up:

  parse-partial-sexp(1 9649428)
  font-lock-fontify-syntactically-region(9649428 9650100 nil)
  font-lock-default-fontify-region(9649428 9650019 nil)
  font-lock-fontify-region(9649428 9650019)
  run-hook-with-args(font-lock-fontify-region 9649428 9650019)
  jit-lock-fontify-now(9649428 9649928)
  jit-lock-function(9649428)
  scroll-down(nil)

Don't like the look of that parse-partial-sexp ! I realise the real fix is
something like

(add-to-list 'auto-mode-alist '("^/var/log" . fundamental-mode))

 but should anything be parsing 9meg of text for just-in-time hilighting?

R
-- 
Science is to computer science as hydrodynamics is to
plumbing.			-- Stan Kelly-Bootle

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: inappropriate use of nroff-mode leads to grief
  2002-09-03 19:05 inappropriate use of nroff-mode leads to grief Robert Marshall
@ 2002-09-03 21:44 ` Kai Großjohann
  2002-09-04 17:41 ` Stefan Monnier <foo@acm.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Kai Großjohann @ 2002-09-03 21:44 UTC (permalink / raw)


Robert Marshall <spam@capuchin.co.uk> writes:

>  but should anything be parsing 9meg of text for just-in-time hilighting?

Well, jit-lock tries to parse less than the whole file...

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: inappropriate use of nroff-mode leads to grief
  2002-09-03 19:05 inappropriate use of nroff-mode leads to grief Robert Marshall
  2002-09-03 21:44 ` Kai Großjohann
@ 2002-09-04 17:41 ` Stefan Monnier <foo@acm.com>
  2002-09-04 19:50   ` Robert Marshall
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-09-04 17:41 UTC (permalink / raw)


>>>>> "Robert" == Robert Marshall <spam@capuchin.co.uk> writes:
> I use logrotate to compress /var/log files so these are saved as (e.g)
> syslog.1.gz

That's unfortunate.  We should try to provide a fix for it.

>   parse-partial-sexp(1 9649428)

Aaarrg!!
nroff-mode tries to avoid such large scans by setting
font-lock-beginning-of-defun to something more-or-less meaningful
(beginning-of-paragraph, IIRC) but in your case that doesn't help
because there's probably no empty line so it still ends up
scanning everything.

The development version of Emacs improves this by caching the result
of the scan, so it does large scans as well, but hopefully not too often.
(i.e. the first time you jump to the end of the file, it will scan the
whole file, but after wards it will only rescan smaller parts of it).


        Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: inappropriate use of nroff-mode leads to grief
  2002-09-04 17:41 ` Stefan Monnier <foo@acm.com>
@ 2002-09-04 19:50   ` Robert Marshall
  2002-09-06 18:25     ` Stefan Monnier <foo@acm.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Marshall @ 2002-09-04 19:50 UTC (permalink / raw)


On 04 Sep 2002, monnier+gnu.emacs.help/news/@flint.cs.yale.edu wrote:

>>>>>> "Robert" == Robert Marshall <spam@capuchin.co.uk> writes:
>> I use logrotate to compress /var/log files so these are saved as
>> (e.g) syslog.1.gz
> 
> That's unfortunate.  We should try to provide a fix for it.
> 
>>   parse-partial-sexp(1 9649428)
> 
..
> 
> The development version of Emacs improves this by caching the result
> of the scan, so it does large scans as well, but hopefully not too
> often.  (i.e. the first time you jump to the end of the file, it
> will scan the whole file, but after wards it will only rescan
> smaller parts of it).
> 

So it does (emacs from cvs) that's a lot smoother!
Even the first scroll is pretty imperceptible

R
-- 
Science is to computer science as hydrodynamics is to
plumbing.			-- Stan Kelly-Bootle

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: inappropriate use of nroff-mode leads to grief
  2002-09-04 19:50   ` Robert Marshall
@ 2002-09-06 18:25     ` Stefan Monnier <foo@acm.com>
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-09-06 18:25 UTC (permalink / raw)


> So it does (emacs from cvs) that's a lot smoother!

Thanks!  So it looks like I didn't waste my time ;-)

> Even the first scroll is pretty imperceptible

I guess you got lucky,


        Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-06 18:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-03 19:05 inappropriate use of nroff-mode leads to grief Robert Marshall
2002-09-03 21:44 ` Kai Großjohann
2002-09-04 17:41 ` Stefan Monnier <foo@acm.com>
2002-09-04 19:50   ` Robert Marshall
2002-09-06 18:25     ` Stefan Monnier <foo@acm.com>

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).