hniksic / emacs-htmlize

Convert buffer text and decorations to HTML.
193 stars 44 forks source link

Replace cl with cl-lib #22

Closed jabranham closed 4 years ago

jabranham commented 6 years ago

cl was obsoleted with GNU Emacs 24.3 and now issues byte compile warnings, especially when required at runtime.

This PR makes htmlize prefer the namespace clean functions from cl-lib instead of cl.

This'll break compatibility with GNU Emacs 24.2 and lower. I couldn't find what the minimum required version of Emacs is.

hniksic commented 6 years ago

The point of the cl extensions is to give the code a CL-style look&feel, and enforcing the cl- prefix removes that part of the appeal. The extensions have been shipped with Emacs for 20+ years, and used by htmlize since the beginning. Unless there is a serious indication that the non-prefixed symbols are to be removed altogether, I would prefer to keep using them.

Is it possible to silence the warnings instead? Most byte-compilation warnings have a way to turn them off.

jabranham commented 6 years ago

Is it possible to silence the warnings instead?

Yes, they already are.

I looked into this because cl isn't supposed to be required by packages at runtime. I had forgotten to require it at compile time in an unrelated file and had problems tracking down the bug because htmlize loads it at runtime (so my compiler knew about it but not the user's).

phikal commented 5 years ago

Since cl has been declared even more obsolete, could this issue be reconsidered again?

hniksic commented 5 years ago

@phikal Yes, we should move away from cl. A problem with the original change was that it was incompatible with Emacsen prior to 24.3, which broke it on the Emacs I was using at the time.

takaxp commented 4 years ago

We have a good example here: https://github.com/emacs-php/php-mode/pull/203/files#diff-6caa62262a5e21bf011a728cd018371fR91

wasamasa commented 4 years ago

Emacs 24.4 is from 2014. Do you really test with a six years old version of that text editor? Even on Debian oldstable it's 24.5 and cl-lib should just work. Please let's not bend over for this as Emacs 27.1 has been finally released and added one more incentive to upgrade: It now shows a warning when (require 'cl) is used at runtime (as is the case here).