* bug#2134: [PATCH] progmodes/compile.el: check global-font-lock-mode
@ 2009-01-31 12:34 Jari Aalto
2009-01-31 19:54 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Jari Aalto @ 2009-01-31 12:34 UTC (permalink / raw
To: submit
Tags: patch
Here is patch to not to turn on font-lock unconditionally. Patch is
against Emacs version control tree check out 2009-01-31.
2009-01-31 Jari Aalto <jari.aalto@cante.net>
* progmodes/compile.el (compilation-start): Run
`font-lock-fontify-buffer' only if `global-font-lock-mode'
is non-nil.
From 473ca5257db6da8da4d31e4b9a2682f0972cc8c1 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@cante.net>
Date: Sat, 31 Jan 2009 14:27:23 +0200
Subject: [PATCH] lisp/progmodes/compile.el: (compilation-start): check global-font-lock-mode
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
lisp/progmodes/compile.el | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 2554730..1259403 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1326,7 +1326,8 @@ Returns the compilation buffer created."
;; Without async subprocesses, the buffer is not yet
;; fontified, so fontify it now.
(let ((font-lock-verbose nil)) ; shut up font-lock messages
- (font-lock-fontify-buffer))
+ (if global-font-lock-mode
+ (font-lock-fontify-buffer)))
(set-buffer-modified-p nil)
(message "Executing `%s'...done" command)))
;; Now finally cd to where the shell started make/grep/...
--
1.5.6.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#2134: [PATCH] progmodes/compile.el: check global-font-lock-mode
2009-01-31 12:34 bug#2134: [PATCH] progmodes/compile.el: check global-font-lock-mode Jari Aalto
@ 2009-01-31 19:54 ` Stefan Monnier
2009-02-01 10:46 ` Jari Aalto
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2009-01-31 19:54 UTC (permalink / raw
To: Jari Aalto; +Cc: 2134
> Here is patch to not to turn on font-lock unconditionally. Patch is
> against Emacs version control tree check out 2009-01-31.
If you read the rest of the compile.el code, you'll see that it uses
font-lock to do its job, which is why it's turned on unconditionally.
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#2134: [PATCH] progmodes/compile.el: check global-font-lock-mode
2009-01-31 19:54 ` Stefan Monnier
@ 2009-02-01 10:46 ` Jari Aalto
2009-02-01 22:54 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Jari Aalto @ 2009-02-01 10:46 UTC (permalink / raw
To: Stefan Monnier; +Cc: 2134
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> Here is patch to not to turn on font-lock unconditionally. Patch is
>> against Emacs version control tree check out 2009-01-31.
>
> If you read the rest of the compile.el code, you'll see that it uses
> font-lock to do its job, which is why it's turned on unconditionally.
>
The buffer handling could be improved to work without font lock. In some
cases the colors distract reading; thus font-lock is turned offm, but
RET no longer intreprets the line.
SUGGESTION
There could be be alternative handler to read the current line and
respond to RET (etc.) when font-lock is turned off. I'm supposing here
that standard grep syntax would be easy to handle:
default-directory: DIR
FILE:LINE:MATCH
Jari
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#2134: [PATCH] progmodes/compile.el: check global-font-lock-mode
2009-02-01 10:46 ` Jari Aalto
@ 2009-02-01 22:54 ` Stefan Monnier
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2009-02-01 22:54 UTC (permalink / raw
To: Jari Aalto; +Cc: 2134
>>> Here is patch to not to turn on font-lock unconditionally. Patch is
>>> against Emacs version control tree check out 2009-01-31.
>>
>> If you read the rest of the compile.el code, you'll see that it uses
>> font-lock to do its job, which is why it's turned on unconditionally.
> The buffer handling could be improved to work without font lock. In some
Yes, we indeed want that. Patches welcome.
The way it could work (most likely) is by not hooking directly into
font-lock but using after-change-functions instead (and then probably
call font-lock-fontify-region (or somesuch function) from it), and only
set the `font-lock-face' property rather than `face'.
Another way to do that, would be to change font-lock-mode to allow
"invisible" activation such that `font-lock-face' is not remapped to
`face' and such that font-lock keywords end up adding entries to
`font-lock-face' rather than to `face', so that the user can later on
turn on font-lock-mode (in normal mode) at which point all the faces
would be activated. That would be better.
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-02-01 22:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 12:34 bug#2134: [PATCH] progmodes/compile.el: check global-font-lock-mode Jari Aalto
2009-01-31 19:54 ` Stefan Monnier
2009-02-01 10:46 ` Jari Aalto
2009-02-01 22:54 ` Stefan Monnier
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.