From: Hrvoje Niksic <hniksic@xemacs.org>
Cc: emacs-devel@gnu.org
Subject: Re: (font-lock-mode 1) does not always force font-lock
Date: Fri, 24 Oct 2003 00:30:17 +0200 [thread overview]
Message-ID: <m31xt3io3q.fsf@hniksic.iskon.hr> (raw)
In-Reply-To: <E1ACkM2-0004mL-5n@fencepost.gnu.org> (Richard Stallman's message of "Thu, 23 Oct 2003 14:38:38 -0400")
Richard Stallman <rms@gnu.org> writes:
> This returns nil because `(font-lock-mode 1)' does not force
> font-lock, contrary to the docstring which, in GNU Emacs 21.2.1,
> states:
>
> With arg, turn Font Lock mode off if and only if arg is a
> non-positive number; if arg is nil, toggle Font Lock mode;
> anything else turns Font Lock on.
>
> I assume the problem is that the buffer is that the buffer in
> question is temporary.
>
> that seems like a bug to me. perhaps it is a consequence of a
> feature meant for some other case.
It was probably meant to prevent unwanted fontification of temporary
buffers for users who turn on font-lock from a global hook or who use
global-font-lock-mode.
The idea is correct, but the place is wrong. The code that excludes
temporary buffers from font-lock should be in global-font-lock-mode or
perhaps in turn-on-font-lock, but not in font-lock-mode proper.
> what code tests this?
I don't have the sources handy. It seems that the code recognizes the
buffer as temporary by checking for names that begins with space. For
instance, this works (returns t):
(let ((newbuf (generate-new-buffer "*foo*")))
(with-current-buffer newbuf
(c-mode)
(font-lock-mode 1)
(prog1 font-lock-mode
(kill-buffer (current-buffer)))))
Change "*foo*" to " *foo*", and it no longer works, i.e. it returns
nil.
> can u suggest a patch?
I don't have a patch, sorry.
next prev parent reply other threads:[~2003-10-23 22:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m3smlkygno.fsf@hniksic.iskon.hr>
2003-10-23 18:38 ` (font-lock-mode 1) does not always force font-lock Richard Stallman
2003-10-23 22:30 ` Hrvoje Niksic [this message]
2003-10-24 5:22 ` Alexander Pohoyda
2003-10-24 9:49 ` Hrvoje Niksic
2003-10-24 19:12 ` Alexander Pohoyda
2003-10-24 20:15 ` Hrvoje Niksic
2003-10-25 7:35 ` Alexander Pohoyda
2003-10-25 9:52 ` Hrvoje Niksic
2003-10-26 11:32 ` Alexander Pohoyda
2003-10-26 16:56 ` Hrvoje Niksic
2003-10-26 19:07 ` Stefan Monnier
2003-10-27 23:44 ` Richard Stallman
2003-10-28 22:09 ` Alexander Pohoyda
2003-11-18 21:13 ` Alexander Pohoyda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m31xt3io3q.fsf@hniksic.iskon.hr \
--to=hniksic@xemacs.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).