all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#43780: 27.1; defvaralias and define-obsolete-variable-alias
@ 2020-10-03 18:16 Drew Adams
  2020-10-05  7:47 ` Lars Ingebrigtsen
  2020-10-06 21:41 ` Michael Heerdegen
  0 siblings, 2 replies; 8+ messages in thread
From: Drew Adams @ 2020-10-03 18:16 UTC (permalink / raw)
  To: 43780

I have code that uses `inhibit-null-byte-detection'.  Emacs 27 has
(unfortunately) used `define-obsolete-variable-alias' to declare that
variable obsolete, in favor of the much more erudite and sophisticated
`inhibit-null-byte-detection'.

I don't want my code to forever give a compiler warning for that, and I
don't want to change my code to use (if (boundp...)(...)(...))
everywhere.  And I do want it to continue to be compatible with releases
before Emacs 27.

So I added this, hoping to get back `inhibit-null-byte-detection'
without the annoying gratuitous warning:

(when (> emacs-major-version 26)
  (defvaralias 'inhibit-null-byte-detection
               'inhibit-nul-byte-detection))

The `define-obsolete-variable-alias' is done by `emacs -Q', and my
`defvaralias' comes after that.  So I was hoping it would simply make
`inhibit-null-byte-detection' a recognized alias of the existing new
variable `inhibit-nul-byte-detection' (no?).  Alas, the byte-compiler
still warns that `inhibit-null-byte-detection' is obsolete.

Seems like a bug to me.  Why shouldn't the last alias declaration win?

Please tell me the best way to leave my code alone, using
`inhibit-null-byte-detection', and yet eliminate (only) this
byte-compiler warning.

Should I just use (put 'inhibit-null-byte-detection
'byte-obsolete-variable nil)?

Ideally I'd want to affect only byte-compilation of the given file, and
not want to globally change whether `inhibit-null-byte-detection' is
considered obsolete.

This is a serious question, not rhetorical.

(And please don't perform any more such gratuitous renamings that don't
really help anyone.  There are other, more important things to rename,
if someone is overeager enough to really want to start renaming names
that aren't perfect.)

In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
 of 2020-08-12 built on CIRROCUMULUS
Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.18362
System Description: Microsoft Windows 10 Pro (v10.0.1903.18362.1082)





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-07 23:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-03 18:16 bug#43780: 27.1; defvaralias and define-obsolete-variable-alias Drew Adams
2020-10-05  7:47 ` Lars Ingebrigtsen
2020-10-05 16:27   ` Drew Adams
2020-10-06 21:41 ` Michael Heerdegen
2020-10-06 22:54   ` Drew Adams
2020-10-06 23:15     ` Michael Heerdegen
2020-10-07  0:06       ` Drew Adams
2020-10-07 23:13         ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.