[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reopen bug 535: Problem with highlit regions on Linux virtual termin

From: Alan Mackenzie
Subject: Re: Reopen bug 535: Problem with highlit regions on Linux virtual terminal
Date: Tue, 7 Apr 2009 20:55:09 +0000
User-agent: Mutt/1.5.9i

Hi, Miles!

On Mon, Apr 06, 2009 at 06:30:28PM +0900, Miles Bader wrote:
> Alan Mackenzie <address@hidden> writes:

> > When I start Emacs 23 -Q, all of my buffers (loaded by desktop) are
> > foghorned - I find Emacs in this state unusable.

> All of your buffers have activated  regions when Emacs starts?

> If so, _that_ sounds like a bug (so please try to send a test case);
> needless to say, I think, I do not see this behavior.

In Emacs-22 -Q, enable desktop-save-mode, load some files, create a
region in each file.  DO NOT enable transient-mark-mode (or anything
similar).  Exit Emacs, creating .emacs.desktop.

Have a look at this .emacs.desktop.  It will contain buffer entries like

(desktop-create-buffer 206
  '(abbrev-mode hi-lock-mode)
  '(8314 t)           ; <==============================================
  '((buffer-file-coding-system . undecided-unix)))

The cons in the marked line is of the mark and the variable
`mark-active'.  This variable doesn't have a coherent definition, but it
causes the region to be highlit.  It is "defined" as

    Non-nil means the mark and region are currently active in this

As I have pointed out before, this is Humpty Dumpty language, liable to
cause bugs.  The mark and the region are never "active" and cannot be
active - so to assert is a category error; they don't do anything, they
are never agents.  I don't know what it means for a mark to be "active"
and for a region to be "active" - I don't think it's defined anywhere,
and there is certainly no entry in the Concept Index for "active".  It
seems that the hacker who created `mark-active' had a different
understanding from the hacker who wrote desktop.el, hence this bug.  As
it is, `mark-active' is meaningless unless transient-mark-mode is
enabled.  Hence the arbitrariness of the `t' in (8314 t).

My suggestion for a fix:
(i) The variable `mark-active' should be renamed to what it actually
means, together with an alias.  Other similarly named variables should
also be renamed as needed to make their names meaningful; all uses of
these variables should be checked.
(ii) The concept "active" should be defined in the Emacs manual.
(ii) desktop-mode.el should be enhanced to record the state of
`transient-mark-mode' in .emacs.desktop.
(iii) On loading the desktop, buffers' regions should not be highlit
unless `transient-mark-mode' is recorded with a non-nil state.

> -Miles

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]