bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#46302: 28.0.50; cperl-mode cleanup: Eliminate dead code


From: Harald Jörg
Subject: bug#46302: 28.0.50; cperl-mode cleanup: Eliminate dead code
Date: Fri, 05 Feb 2021 11:54:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> Isn't `make-obsolete-variable` supposed to generate a compiler warning?
>
> It is supposed to, but somehow it didn't... [...]
>
> Hm...  perhaps it's because of this?
>
> -  (if cperl-use-syntax-table-text-property
> -      (if (eval-when-compile (fboundp 'syntax-propertize-rules))
> -          (progn
>
> And the compiler got confused and didn't output a warning (always)?

Ah, that reminds me of something... I did the elimination in several
steps, and in one of them killed the conditional and the if-branch, but
forget to kill the else-branch as well.  Apparently I ran the first
compilation test with that (bogus) intermediate version, and got the
warning.

As it turns out, the byte compiler shortcuts the conditional if it
eval-when-compiles to a constant and doesn't even touch the else-branch.
Digging into the commit logs reveals:

  commit 4813c453b22ff7b965e31a30d35b70f73d6bcbc7
  Author: Stefan Monnier <monnier@iro.umontreal.ca>
  Date:   Sun Feb 3 10:47:12 2013 -0500

      * lisp/progmodes/cperl-mode.el (cperl-mode): Avoid byte-compile
        warning.

Now it all makes sense :)
-- 
Cheers,
haj





reply via email to

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