unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: monnier+gnu/emacs@rum.cs.yale.edu, y@mit.edu,
	mh-e-devel@lists.sourceforge.net, emacs-devel@gnu.org
Subject: Re: problem with mh-e and 2002-08-20 change to font-core.el
Date: Thu, 29 Aug 2002 11:25:42 -0400	[thread overview]
Message-ID: <200208291525.g7TFPgG10906@rum.cs.yale.edu> (raw)
In-Reply-To: E17kCJI-0000zH-00@fencepost.gnu.org

>     > That would not do the job; it would fail to remove all the properties
>     > which the current code removes.
> 
>     Can you give examples ?
> 
> Modes that use font-lock-face are an example.  The current code
> removes that property; just turning off font-lock-mode would not
> remove it.
> 
> font-lock-face properties go in mode-specific places.

But do the properties belong to the text or to the mode.
I have the impression that most of those font-lock-face properties
are added together with the corresponding text and that they can't
be recovered just from the text.  I.e. erasing them might not
be the right thing to do since it loses information.

>     PS: And the current code fails to remove those properties if you didn't
> 	turn font-lock-mode ON, which doesn't make much sense either.
> 
> Sorry, I don't understand.  Would you say that more clearly?

The "erase the font-lock-face property when changing-mode" hook you
added is only added when you turn on font-lock-mode, so the
font-lock-face property will stay if you don't turn on font-lock-mode
before changing major-mode.

Examples:

	emacs -q --no-site-file
	M-x ibuffer
	M-x text-mode
	M-: (ibuffer-mode)
	M-x font-lock-mode

you see the font-locked text.  Now try this instead:

	emacs -q --no-site-file
	M-x ibuffer
	M-x font-lock-mode
	M-x text-mode
	M-: (ibuffer-mode)
	M-x font-lock-mode

now you don't see any fontification.
I actually think that the first behavior is more correct and
corresponds to what happens if you call (font-lock-mode -1) instead
of forcefully erasing the font-lock-face property.


	Stefan

PS: The elisp manual clearly says in the "major mode conventions"
node to "Define a command whose name ends in `-mode'" so ibuffer-mode
should be interactive.  I'd of course argue that it should use
`define-derived-mode' which would have made it interactive as a matter
of course without the programmer having to think about it.
As long as we don't use such a macro systematically, we'll have to live
with all those inconsistencies.

  reply	other threads:[~2002-08-29 15:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-26  7:38 problem with mh-e and 2002-08-20 change to font-core.el y
2002-08-26 21:18 ` Luc Teirlinck
2002-08-26 23:23   ` Luc Teirlinck
2002-08-26 23:57     ` Luc Teirlinck
2002-08-27 19:05   ` Richard Stallman
2002-08-28  5:51     ` chad
2002-08-28 23:32       ` Richard Stallman
2002-09-27 17:35         ` Bill Wohler
2002-08-26 21:51 ` Richard Stallman
2002-08-26 22:09   ` Stefan Monnier
2002-08-28  6:53     ` Richard Stallman
2002-08-28 13:55       ` Stefan Monnier
2002-08-28 23:33         ` Richard Stallman
2002-08-29 15:25           ` Stefan Monnier [this message]
2002-08-30  6:09             ` Richard Stallman
2002-08-30 13:42               ` Stefan Monnier
2002-09-01 13:15                 ` Richard Stallman
2002-09-02 17:05                   ` Stefan Monnier

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=200208291525.g7TFPgG10906@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    --cc=mh-e-devel@lists.sourceforge.net \
    --cc=y@mit.edu \
    /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).