GNU bug report logs - #29422
27.0.50; Symbol enable-multibyte-characters may not be buffer-local

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Fri, 24 Nov 2017 07:58:01 UTC

Severity: normal

Found in version 27.0.50

Done: Michael Heerdegen <michael_heerdegen <at> web.de>

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 29422 in the body.
You can then email your comments to 29422 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#29422; Package emacs. (Fri, 24 Nov 2017 07:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 24 Nov 2017 07:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Symbol enable-multibyte-characters may not be buffer-local
Date: Fri, 24 Nov 2017 08:56:42 +0100
C-h i i
==>
Debugger entered--Lisp error: (error "Symbol enable-multibyte-characters may not be buffer-local")
  make-local-variable(enable-multibyte-characters)
  [...]
  clone-buffer()
  [...]
  command-execute(Info-index)

maybe related to 197dd690?


Thanks,

Michael.


In GNU Emacs 27.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version 3.22.24)
 of 2017-11-24 built on drachen
Repository revision: 3f95bbcbb84f144c93b625d5cffab2d18200115c
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
System Description:	Debian GNU/Linux testing (buster)





Reply sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
You have taken responsibility. (Sat, 25 Nov 2017 01:24:02 GMT) Full text and rfc822 format available.

Notification sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
bug acknowledged by developer. (Sat, 25 Nov 2017 01:24:02 GMT) Full text and rfc822 format available.

Message #10 received at 29422-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 29422-done <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#29422: 27.0.50;
 Symbol enable-multibyte-characters may not be buffer-local
Date: Sat, 25 Nov 2017 02:22:59 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Debugger entered--Lisp error: (error "Symbol enable-multibyte-characters may not be buffer-local")

Apparently has been fixed with d1000fb.


Thanks,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29422; Package emacs. (Sat, 25 Nov 2017 07:54:01 GMT) Full text and rfc822 format available.

Message #13 received at 29422 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 29422 <at> debbugs.gnu.org
Subject: Re: bug#29422: 27.0.50;
 Symbol enable-multibyte-characters may not be buffer-local
Date: Sat, 25 Nov 2017 09:53:33 +0200
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Date: Sat, 25 Nov 2017 02:22:59 +0100
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
> 
> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> 
> > Debugger entered--Lisp error: (error "Symbol enable-multibyte-characters may not be buffer-local")
> 
> Apparently has been fixed with d1000fb.

Yes, but signaling "Setting constant" when we actually mean a
read-only symbol is sub-optimal, IMO.  That error is for setting stuff
like nil and t, which enable-multibyte-characters isn't.  It will
confuse users to see this error in that case, I think.

And the ELisp manual clearly states that this error is for "symbols
that evaluate to themselves": nil, t, and keyword symbols.  So now the
implementation contradicts the documentation.

How about inventing a new error symbol for these cases?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29422; Package emacs. (Sat, 25 Nov 2017 16:48:01 GMT) Full text and rfc822 format available.

Message #16 received at 29422 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 29422 <at> debbugs.gnu.org
Subject: Re: bug#29422: 27.0.50;
 Symbol enable-multibyte-characters may not be buffer-local
Date: Sat, 25 Nov 2017 11:47:25 -0500
> Yes, but signaling "Setting constant" when we actually mean a
> read-only symbol is sub-optimal, IMO.

That's the error that we've been using for (setq
enable-multibyte-characters ...) since Emacs-21.

> How about inventing a new error symbol for these cases?

I haven't found a situation where I needed to distinguish those two
error cases yet, so I don't see any need for that, but if you feel like
it, that's fine (tho better make that new error be a sub-error of
`setting-constant` so as not to break existing code).


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29422; Package emacs. (Sat, 25 Nov 2017 17:20:02 GMT) Full text and rfc822 format available.

Message #19 received at 29422 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: michael_heerdegen <at> web.de, 29422 <at> debbugs.gnu.org
Subject: Re: bug#29422: 27.0.50;
 Symbol enable-multibyte-characters may not be buffer-local
Date: Sat, 25 Nov 2017 19:19:15 +0200
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 29422 <at> debbugs.gnu.org
> Date: Sat, 25 Nov 2017 11:47:25 -0500
> 
> > Yes, but signaling "Setting constant" when we actually mean a
> > read-only symbol is sub-optimal, IMO.
> 
> That's the error that we've been using for (setq
> enable-multibyte-characters ...) since Emacs-21.

??? The code you changed signaled a "Symbol %s may not be
buffer-local" error, not "Setting constant".  What am I missing?

> > How about inventing a new error symbol for these cases?
> 
> I haven't found a situation where I needed to distinguish those two
> error cases yet, so I don't see any need for that, but if you feel like
> it, that's fine (tho better make that new error be a sub-error of
> `setting-constant` so as not to break existing code).

I meant for you to do that, as part of fixing this problem, but if you
don't feel like it, we should at least change the ELisp manual, as it
now contradicts the code.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29422; Package emacs. (Sun, 26 Nov 2017 02:08:01 GMT) Full text and rfc822 format available.

Message #22 received at 29422 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, 29422 <at> debbugs.gnu.org
Subject: Re: bug#29422: 27.0.50;
 Symbol enable-multibyte-characters may not be buffer-local
Date: Sat, 25 Nov 2017 21:07:22 -0500
>> > Yes, but signaling "Setting constant" when we actually mean a
>> > read-only symbol is sub-optimal, IMO.
>> That's the error that we've been using for (setq
>> enable-multibyte-characters ...) since Emacs-21.

> ??? The code you changed signaled a "Symbol %s may not be
> buffer-local" error, not "Setting constant".  What am I missing?

My patch did not touch `setq`.  It just made `make-local-variable` and
`make-buffer-local-variable` signal the same error as `setq`.

> I meant for you to do that, as part of fixing this problem, but if you
> don't feel like it, we should at least change the ELisp manual, as it
> now contradicts the code.

If you mean the doc of `setq`, then I guess this discrepancy has been
with us since Emacs-21.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29422; Package emacs. (Sun, 26 Nov 2017 03:40:01 GMT) Full text and rfc822 format available.

Message #25 received at 29422 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: michael_heerdegen <at> web.de, 29422 <at> debbugs.gnu.org
Subject: Re: bug#29422: 27.0.50;
 Symbol enable-multibyte-characters may not be buffer-local
Date: Sun, 26 Nov 2017 05:39:31 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: michael_heerdegen <at> web.de,  29422 <at> debbugs.gnu.org
> Date: Sat, 25 Nov 2017 21:07:22 -0500
> 
> My patch did not touch `setq`.  It just made `make-local-variable` and
> `make-buffer-local-variable` signal the same error as `setq`.
> 
> > I meant for you to do that, as part of fixing this problem, but if you
> > don't feel like it, we should at least change the ELisp manual, as it
> > now contradicts the code.
> 
> If you mean the doc of `setq`, then I guess this discrepancy has been
> with us since Emacs-21.

Not unheard of, and not a good reason to leave it that way.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29422; Package emacs. (Sun, 26 Nov 2017 15:32:01 GMT) Full text and rfc822 format available.

Message #28 received at 29422 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: michael_heerdegen <at> web.de, 29422 <at> debbugs.gnu.org
Subject: Re: bug#29422: 27.0.50;
 Symbol enable-multibyte-characters may not be buffer-local
Date: Sun, 26 Nov 2017 17:31:36 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: michael_heerdegen <at> web.de,  29422 <at> debbugs.gnu.org
> Date: Sat, 25 Nov 2017 21:07:22 -0500
> 
> >> > Yes, but signaling "Setting constant" when we actually mean a
> >> > read-only symbol is sub-optimal, IMO.
> >> That's the error that we've been using for (setq
> >> enable-multibyte-characters ...) since Emacs-21.
> 
> > ??? The code you changed signaled a "Symbol %s may not be
> > buffer-local" error, not "Setting constant".  What am I missing?
> 
> My patch did not touch `setq`.  It just made `make-local-variable` and
> `make-buffer-local-variable` signal the same error as `setq`.

Which IMO is confusing because the doc string of
enable-multibyte-characters says

  Automatically becomes permanently buffer-local when set.

> > we should at least change the ELisp manual, as it now contradicts
> > the code.
> 
> If you mean the doc of `setq`, then I guess this discrepancy has been
> with us since Emacs-21.

Actually, Emacs 21 said something more reasonable:

  Variable enable-multibyte-characters is read-only

which was different from the error signaled when trying to change the
value of, say, t.  Only Emacs 22.1 tossed the difference and started
to signal the same error for both.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29422; Package emacs. (Mon, 27 Nov 2017 04:43:02 GMT) Full text and rfc822 format available.

Message #31 received at 29422 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, 29422 <at> debbugs.gnu.org
Subject: [SUSPECTED SPAM] Re: bug#29422: 27.0.50;
 Symbol enable-multibyte-characters may not be buffer-local
Date: Sun, 26 Nov 2017 23:42:20 -0500
>> My patch did not touch `setq`.  It just made `make-local-variable` and
>> `make-buffer-local-variable` signal the same error as `setq`.
> Which IMO is confusing because the doc string of
> enable-multibyte-characters says
>   Automatically becomes permanently buffer-local when set.

Yes, it's a weird critter.  Some versions ago, you could setq-default on
it, whereas you couldn't setq on it.
It'd arguably be cleaner if it were a function rather than a variable.

> Actually, Emacs 21 said something more reasonable:
>
>   Variable enable-multibyte-characters is read-only
>
> which was different from the error signaled when trying to change the
> value of, say, t.  Only Emacs 22.1 tossed the difference and started
> to signal the same error for both.

Oh, right, Gerd only added defvaralias in Emacs-22 (which is why/when
it get unified into the `constant` bit field, IIRC).


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 25 Dec 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.