GNU bug report logs -
#3628
Python-Mode Ignores Global Font Lock
Previous Next
Reported by: "Sean B. Palmer" <sean <at> miscoranda.com>
Date: Sat, 20 Jun 2009 15:55:04 UTC
Severity: normal
Merged with 4303
Found in version 23.1
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3628 in the body.
You can then email your comments to 3628 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3628
; Package
emacs
.
(Sat, 20 Jun 2009 15:55:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Sean B. Palmer" <sean <at> miscoranda.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Sat, 20 Jun 2009 15:55:05 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
In my .emacs file I turn off global font lock:
(global-font-lock-mode 0)
The effect is to turn syntax highlighting OFF in modes where there
would normally be syntax highlighting by default. The result in emacs
22.1.1 was to remove syntax highlighting from Perl, C, and Python
files.
In emacs 23.0.95.1 (build details below), this no longer works for
Python files. That is to say, various *.py files that I've tested have
syntax highlighting ON when I edit them in emacs with a normal
command:
$ emacs example.py
$ emacs api.py
Perl and C files have syntax highlighting OFF, on the other hand. When
editing one of the Python files, syntax highlighting can be turned OFF
by using the following procedure:
M-x eval-expression <RET>
(global-font-lock-mode 0) <RET>
In other words, by evaluating the expression from my .emacs file
manually. On repeating the expression, syntax highlighting remains
OFF, so it is apparently not acting as a toggle.
When I use emacs -q, syntax highlighting is ON by default when editing
any Perl, C, or Python file as expected. I've tried using different
positions for the global font lock line in my .emacs file, moving it
to the top, to the middle, and to the bottom, and that has no effect:
syntax highlighting is always ON in Python-Mode.
My full .emacs file is available here:
http://inamidst.com/config/emacs
I'm using the following version of emacs from CVS:
GNU Emacs 23.0.95.1 (i386-apple-darwin8.11.1, X toolkit) of 2009-06-20
Compiled with:
$ ./configure --prefix=$PACKAGES/emacs \
--with-jpeg=no --with-png=no --with-gif=no --with-tiff=no
And there doesn't appear to be any mention of this bug in
etc/PROBLEMS; I also asked in #emacs on freenode about this bug before
they advised me to file this bug by email.
Thanks,
--
Sean B. Palmer, http://inamidst.com/sbp/
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3628
; Package
emacs
.
(Mon, 22 Jun 2009 09:15:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Lawrence Mitchell <wence <at> gmx.li>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 22 Jun 2009 09:15:04 GMT)
Full text and
rfc822 format available.
Message #10 received at 3628 <at> emacsbugs.donarmstrong.com (full text, mbox):
Sean B. Palmer wrote:
> In my .emacs file I turn off global font lock:
> (global-font-lock-mode 0)
[...]
> In emacs 23.0.95.1 (build details below), this no longer works for
> Python files. That is to say, various *.py files that I've tested have
> syntax highlighting ON when I edit them in emacs with a normal
> command:
> $ emacs example.py
> $ emacs api.py
> Perl and C files have syntax highlighting OFF, on the other hand. When
> editing one of the Python files, syntax highlighting can be turned OFF
> by using the following procedure:
> M-x eval-expression <RET>
> (global-font-lock-mode 0) <RET>
> In other words, by evaluating the expression from my .emacs file
> manually. On repeating the expression, syntax highlighting remains
> OFF, so it is apparently not acting as a toggle.
(global-font-lock-mode 0) only turns /off/ font lock
| With prefix arg, turn Global-Font-Lock mode on if and only if
| arg is positive.
I.e., it's not acting as a toggle, but this is intended.
[...]
The overriding of user preference regarding font lock appears to
be a deliberate change. A commit on Feb 21 2008 merges changes
from Dave Love's python.el.
| Author: Chong Yidong <cyd <at> stupidchicken.com>
| Date: Thu Feb 21 17:03:47 2008 +0000
| Merge from Dave Love's 2008-01-20 version.
These include:
| (python-mode): Add python-pea-hook to pre-abbrev-expand-hook. Use
| symbol-completion-try-complete for hippie expansion. Turn on font
| lock unconditionally.
Font-lock is used unconditionally in python buffers, I think, so
that text properties marking strings and comments can be
maintained with greater ease than otherwise. It appears to be a
design decision.
Cheers,
Lawrence
--
Lawrence Mitchell <wence <at> gmx.li>
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3628
; Package
emacs
.
(Mon, 22 Jun 2009 10:05:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Sean B. Palmer" <sean <at> miscoranda.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 22 Jun 2009 10:05:07 GMT)
Full text and
rfc822 format available.
Message #15 received at 3628 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Mon, Jun 22, 2009 at 10:10 AM, Lawrence Mitchell wrote:
> (global-font-lock-mode 0) only turns /off/ font lock
Yeah, but I was asked on #emacs whether it was acting as a toggle,
perhaps just to confirm that there was no bug introducing toggle
behaviour where it wasn't expected.
> Font-lock is used unconditionally in python buffers, I think,
> so that text properties marking strings and comments can
> be maintained with greater ease than otherwise.
Not honouring explicit instructions to turn off highlighting globally
in emacs sounds like a poor design decision to me. I consider this an
important bug.
Meanwhile, it's possible to use this workaround:
(add-hook 'python-mode-hook
'(lambda () (global-font-lock-mode 0)))
Thanks,
--
Sean B. Palmer, http://inamidst.com/sbp/
Merged 3628 4303.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Wed, 27 Jan 2010 03:19:01 GMT)
Full text and
rfc822 format available.
Merged 3628 4303 7771.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Mon, 03 Jan 2011 01:46:02 GMT)
Full text and
rfc822 format available.
Disconnected #7771 from all other report(s).
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Mon, 03 Jan 2011 01:55:01 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to "Sean B. Palmer" <sean <at> miscoranda.com>
Request was from
Stefan Monnier <monnier <at> iro.umontreal.ca>
to
control <at> debbugs.gnu.org
.
(Mon, 03 Jan 2011 03:49:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 31 Jan 2011 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 139 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.