Suggested patch to strip out dead code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
VM |
Triaged
|
Low
|
Uday Reddy |
Bug Description
[ I sent this mail to <email address hidden>, but I"m not sure if that mailing-list is actually in use (I hope it is, I hate those bug-tracker thingies that only work when you're connected), so here's a copy of that message, just in case. ]
The patch below replaces the vm-(x|fsf)emacs-p constants with
(featurep 'xemacs) tests (basically applying constant-folding).
The reason why this is a good idea is that nowadays such featurep calls
are optimized away by the byte-compiler, resulting in more efficient
code since (if (featurep 'xemacs) FOO BAR) can get directly turned into
either FOO or BAR depending on which emacs flavor is used to compile
the file, whereas (if vm-xemacs-p FOO BAR) cannot be optimized similarly
since Elisp allows vm-xemacs-p to be modified later on.
Other than resulting in more efficient code, it also reduces the
false-positive warnings by preventing the byte-compiler from seeing code
that's only meant for the other flavor.
Additionally to doing such constant-folding, the patch adds a few more
changes, such as eliminating the use of `local-map' at one place
(`keymap' is supported in Emacs since Emacs-21), eliminating some dead
code (made more obvious by the constant-folding), and do a bit of
common-
(foo C)) into (foo (if A B C)).
The patch is against the tip of http://
Stefan
Changed in vm: | |
status: | New → Triaged |
importance: | Undecided → Low |
assignee: | nobody → Uday Reddy (reddyuday) |
milestone: | none → 8.2.1a |
Changed in vm: | |
milestone: | 8.2.1a → 8.2.90a |