all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
@ 2004-10-19  6:13 Richard Stallman
  2004-10-19 19:06 ` Daniel Pfeiffer
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2004-10-19  6:13 UTC (permalink / raw)
  Cc: emacs-devel

Can you arrange to make compile mode's propertization
that is necessary for RET and Mouse-1 to work properly
operate independently of whether Font Lock mode is enabled?

One idea would be to use the mechanisms of font-lock mode, but not
fontify.  The idea is that some special hack would make font-lock
operate pretty much normally even though font-lock-mode is nil, but it
would not put on any `face' properties.  This could be a feature for
modes that "need" font-lock in order to "work right".

I think this could be done fairly easily.


------- Start of forwarded message -------
From: Richard Stallman <rms@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
In-reply-to: <871xfxm5p6.fsf-monnier+emacs@gnu.org> (message from Stefan
	Monnier on Sun, 17 Oct 2004 16:50:02 -0400)
Date: Mon, 18 Oct 2004 09:59:19 -0400
Cc: emacs-pretest-bug@gnu.org, drew.adams@oracle.com
Subject: Re: mouse cannot be used in *grep* buffer if font-lock is turned off
Reply-To: rms@gnu.org
Sender: emacs-pretest-bug-bounces+rms=gnu.org@gnu.org
X-Spam-Status: No, hits=-0.5 required=5.0
	tests=IN_REP_TO,RCVD_IN_ORBS,REFERENCES
	version=2.55
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)

    We should hack something so that M-x font-lock-mode in a *grep* buffer
    signals an error or does something more clever.  Font-lock is *necessary*
    for Emacs-21's *grep* buffer.

The problem is that setting up the properties that compilation mode
depends on uses Font Lock mode.  It's ok to use the Font Lock
mechanism, but it shouldn't be affected by turning Font Lock mode
on or off.



_______________________________________________
Emacs-pretest-bug mailing list
Emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

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

* Re: [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
  2004-10-19  6:13 [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off] Richard Stallman
@ 2004-10-19 19:06 ` Daniel Pfeiffer
  2004-10-19 19:43   ` Stefan Monnier
  2004-10-19 20:59   ` David Kastrup
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Pfeiffer @ 2004-10-19 19:06 UTC (permalink / raw)
  Cc: Juri Linkov, emacs-devel

Saluton,

Richard Stallman <rms@gnu.org> skribis:

> Can you arrange to make compile mode's propertization
> that is necessary for RET and Mouse-1 to work properly
> operate independently of whether Font Lock mode is enabled?

I had to put the additional properties I set, into some variable.  This might
have been in order to get them unset when turning off font-lock.  If that's
not desired, we could not set that variable.

> One idea would be to use the mechanisms of font-lock mode, but not
> fontify.  The idea is that some special hack would make font-lock
> operate pretty much normally even though font-lock-mode is nil, but it
> would not put on any `face' properties.  This could be a feature for
> modes that "need" font-lock in order to "work right".

This sounds like a step further: font-lock without fonts, i.e. a property lock
mode.  Actually I can't for the life of me imagine why anybody would not want
font-locking, even vi can do it nowadays.  It adds so much legibility, I feel
it should be on by default.  My oldish 500MHz P3 can handle it easily and I'm
pretty sure I used without great penalty way back on my 100MHz box.

An easy workaround for those who want it, is to customize the faces to
default.

> I think this could be done fairly easily.

While I find font-lock very useful, I must admit its inner workings are
somewhat of black magic to me, especially the complicated way it gets set up. 
But I think the requester only meant a means of making font-lock not
unsettable, or such that an warning question gets asked first.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- 
lerne / learn / apprends / lär dig / ucz się    Esperanto:
                              http://lernu.net/

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

* Re: [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
  2004-10-19 19:06 ` Daniel Pfeiffer
@ 2004-10-19 19:43   ` Stefan Monnier
  2004-10-21  1:45     ` Richard Stallman
  2004-10-19 20:59   ` David Kastrup
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2004-10-19 19:43 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

> This sounds like a step further: font-lock without fonts, i.e. a property
> lock mode.  Actually I can't for the life of me imagine why anybody would
> not want font-locking, even vi can do it nowadays.  It adds so much
> legibility, I feel it should be on by default.  My oldish 500MHz P3 can
> handle it easily and I'm pretty sure I used without great penalty way back
> on my 100MHz box.

I tend to agree.  I think if the only reason not to turn on font-lock is
because the visual effects are annoying, then I suggest the following:

- always turn on the font-lock machinery.
- font-lock.el places face properties on the `font-lock-face' property.

M-x font-lock-mode does nothing more than

  (set (make-local-variable 'char-property-alias-alist)
       (cons '(face font-lock-face) char-property-alias-alist))


-- Stefan

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

* Re: [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
  2004-10-19 19:06 ` Daniel Pfeiffer
  2004-10-19 19:43   ` Stefan Monnier
@ 2004-10-19 20:59   ` David Kastrup
  2004-10-19 21:59     ` Daniel Pfeiffer
  1 sibling, 1 reply; 9+ messages in thread
From: David Kastrup @ 2004-10-19 20:59 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

dapfy@t-online.de (Daniel Pfeiffer) writes:

> This sounds like a step further: font-lock without fonts, i.e. a
> property lock mode.  Actually I can't for the life of me imagine why
> anybody would not want font-locking, even vi can do it nowadays.  It
> adds so much legibility, I feel it should be on by default.

It _removes_ legibility since it decreases the already low contrast
(as compared to paper) of computer screens further.  I don't work with
font lock at all and find it very distracting in addition to
unreadable.

That being said, I second that it should be on by default.  I'll turn
it off first thing, but it is the kind of thing beginners expect.
However, we would need a command line option to turn it off, too, or
people with disabilities or screen readers might be unable to even
handle turning off the default fontification via customize.

> My oldish 500MHz P3 can handle it easily and I'm pretty sure I used
> without great penalty way back on my 100MHz box.

How often do you edit 1MB text files with complex patterns?  That is
not unusual if you are preparing a book.

> An easy workaround for those who want it, is to customize the faces
> to default.

But there is no sense in forcing a heavy performance penalty if you
don't even see a thing.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
  2004-10-19 20:59   ` David Kastrup
@ 2004-10-19 21:59     ` Daniel Pfeiffer
  2004-10-19 22:39       ` David Kastrup
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Pfeiffer @ 2004-10-19 21:59 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

Moin David,

David Kastrup <dak@gnu.org> skribis:

> However, we would need a command line option to turn it off, too, or
> people with disabilities or screen readers might be unable to even
> handle turning off the default fontification via customize.

That's a good point!  They might profit from the early black & white font-lock
style (like I try to keep my setup as far as possible -- colours always remind
me of M$-Windoze).  Maybe the customizability of faces should evolve more in
the CSS direction, with accessability, reader and printer styles.

> > An easy workaround for those who want it, is to customize the faces
> > to default.
> 
> But there is no sense in forcing a heavy performance penalty if you
> don't even see a thing.

I too am not sure about the argument of always running this if you get no
benefit.  As for compilation and grep the benefit is clear.  Font-lock has
rather good parsing capabilities, and these modes need that.  The gaudiness is
a side effect really.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- 
lerne / learn / apprends / lär dig / ucz się    Esperanto:
                              http://lernu.net/

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

* Re: [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
  2004-10-19 21:59     ` Daniel Pfeiffer
@ 2004-10-19 22:39       ` David Kastrup
  2004-10-20  7:07         ` Daniel Pfeiffer
  0 siblings, 1 reply; 9+ messages in thread
From: David Kastrup @ 2004-10-19 22:39 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

dapfy@t-online.de (Daniel Pfeiffer) writes:

> I too am not sure about the argument of always running this if you
> get no benefit.  As for compilation and grep the benefit is clear.
> Font-lock has rather good parsing capabilities, and these modes need
> that.  The gaudiness is a side effect really.

Sounds like the "if all you have is a hammer, every problem looks like
a nail" concept.  If font lock is employed for something it is not
intended for because of efficiency, maybe we need to abtract the
parsing parts into useful packages of their own and make font lock use
them.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
  2004-10-19 22:39       ` David Kastrup
@ 2004-10-20  7:07         ` Daniel Pfeiffer
  2004-10-21  1:46           ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Pfeiffer @ 2004-10-20  7:07 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

Saluton,

David Kastrup <dak@gnu.org> skribis:

> dapfy@t-online.de (Daniel Pfeiffer) writes:
> > I too am not sure about the argument of always running this if you
> > get no benefit.

Come to think of it, imenu is highly redundant with what font-lock does.  And
many modes set it up, whether you use it or not.  Same goes for
outline-minor-mode, which can't fontify the "headlines", because it's not
integrated with font-lock.

> >  As for compilation and grep the benefit is clear.
> > Font-lock has rather good parsing capabilities, and these modes need
> > that.  The gaudiness is a side effect really.
> 
> Sounds like the "if all you have is a hammer, every problem looks like
> a nail" concept.  If font lock is employed for something it is not
> intended for because of efficiency, maybe we need to abtract the
> parsing parts into useful packages of their own and make font lock use
> them.

True.  But font-lock is already so widely supported, that it's gonna be hard
to change radically.  As for setting other properties, this is a fairly recent
add-on.  It was done in such a way, that it does not allow not setting `face'.
 Maybe that part could be prudentially loosened.

Compile/grep uses the same regexps to understand the output, as it does to
highlight them.  Here there would be no benefit from dissociating the two. 
Stef's suggestion of making faces show optionally makes more sence for that.

Parsing can't ever be good enough.  Emacs for e-lisp and Eclipse for Java are
about as close as you can get -- and even they are not perfect (think of a `('
in the fist column of a string).  They have an "unfair" advantage, being able
to look into the interpreter.

For all others we must try real hard to understand the buffer contents.
Font-lock, for all its restrictions, is by far the best parser we have, so we
need to build up on that.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- 
lerne / learn / apprends / lär dig / ucz się    Esperanto:
                              http://lernu.net/

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

* Re: [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
  2004-10-19 19:43   ` Stefan Monnier
@ 2004-10-21  1:45     ` Richard Stallman
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2004-10-21  1:45 UTC (permalink / raw)
  Cc: juri, occitan, emacs-devel

    I tend to agree.  I think if the only reason not to turn on font-lock is
    because the visual effects are annoying, then I suggest the following:

    - always turn on the font-lock machinery.
    - font-lock.el places face properties on the `font-lock-face' property.

    M-x font-lock-mode does nothing more than

      (set (make-local-variable 'char-property-alias-alist)
	   (cons '(face font-lock-face) char-property-alias-alist))

How about doing this, not always, but for certain modes (like
Compilation mode)?

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

* Re: [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off]
  2004-10-20  7:07         ` Daniel Pfeiffer
@ 2004-10-21  1:46           ` Richard Stallman
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2004-10-21  1:46 UTC (permalink / raw)
  Cc: juri, emacs-devel

    Come to think of it, imenu is highly redundant with what font-lock does.  And
    many modes set it up, whether you use it or not.

Many modes specify how imenu should search.  However, imenu doesn't do
anything unless you try to use it.

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

end of thread, other threads:[~2004-10-21  1:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-19  6:13 [rms@gnu.org: Re: mouse cannot be used in *grep* buffer if font-lock is turned off] Richard Stallman
2004-10-19 19:06 ` Daniel Pfeiffer
2004-10-19 19:43   ` Stefan Monnier
2004-10-21  1:45     ` Richard Stallman
2004-10-19 20:59   ` David Kastrup
2004-10-19 21:59     ` Daniel Pfeiffer
2004-10-19 22:39       ` David Kastrup
2004-10-20  7:07         ` Daniel Pfeiffer
2004-10-21  1:46           ` Richard Stallman

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.