Add cl-lib.el a compat lib to cope with FSF CL nonsense.
authorSteve Youngs <steve@sxemacs.org>
Mon, 10 Feb 2020 09:17:52 +0000 (19:17 +1000)
committerSteve Youngs <steve@sxemacs.org>
Mon, 10 Feb 2020 09:17:52 +0000 (19:17 +1000)
* README: Mention hddtemp.el, sy-git.el, and cl-lib.el
Plus note that lj.el is non-working.

* cl-lib.el: New

Signed-off-by: Steve Youngs <steve@sxemacs.org>
README
cl-lib.el [new file with mode: 0644]

diff --git a/README b/README
index 80821df..70f2890 100644 (file)
--- a/README
+++ b/README
@@ -5,12 +5,14 @@ even useful.
 
         dired-tar.el -- Handle tarballs in Dired.  Updated to support
                         bzip2, lzma, and xz.
+          hddtemp.el -- Report hard disc temperatures
           ffi-mpd.el -- non-working
 footnote-balloons.el -- Display footnotes in a balloon-help frame.
          ges-post.el -- Ease sending lisp to gnu.emacs.sources
      google-query.el -- Search Google from within (S)XEmacs
      linux-kernel.el -- Check the lastest Linux kernel release
                lj.el -- Post entries to a LiveJournal blog
+                        I think currently broken (API changes)
               mpd.el -- Control mpd (Music Player Daemon
                         http://www.musicpd.org) from SXEmacs.
           mozmail.el -- Compose mail in a emacs MUA from mailto links in
@@ -22,6 +24,8 @@ footnote-balloons.el -- Display footnotes in a balloon-help frame.
             sxell.el -- SXEmacs interface to the Emacs Lisp List
              snap.el -- An updated version of snap.el (from the howm
                         guy).  This one supports (S)XEmacs.
+           sy-git.el -- Some handy-dandy git related things
+           cl-lib.el -- The beginnings of FSF CL compatibility layer
 
 
 Installation:
diff --git a/cl-lib.el b/cl-lib.el
new file mode 100644 (file)
index 0000000..5214083
--- /dev/null
+++ b/cl-lib.el
@@ -0,0 +1,262 @@
+;; cl-lib.el --- Compatibility for FSF CL madness   -*- Emacs-Lisp -*-
+
+;; Copyright (C) 2020 Steve Youngs
+
+;; Author:     Steve Youngs <steve@sxemacs.org>
+;; Maintainer: Steve Youngs <steve@sxemacs.org>
+;; Created:    <2020-02-09>
+;; Time-stamp: <Sunday Feb  9, 2020 16:07:26 steve>
+;; Homepage:   https://git.sxemacs.org/slh
+;; Keywords:   compat, cl
+
+;; This file is part of slh (Steve's Lisp Hacks)
+
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions
+;; are met:
+;;
+;; 1. Redistributions of source code must retain the above copyright
+;;    notice, this list of conditions and the following disclaimer.
+;;
+;; 2. Redistributions in binary form must reproduce the above copyright
+;;    notice, this list of conditions and the following disclaimer in the
+;;    documentation and/or other materials provided with the distribution.
+;;
+;; 3. Neither the name of the author nor the names of any contributors
+;;    may be used to endorse or promote products derived from this
+;;    software without specific prior written permission.
+;;
+;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;; DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+;;; Commentary:
+;;
+;;     For reasons that are beyond me, the FSF recently renamed all of
+;;     their CL stuff from 'func-name' to 'cl-func-name', and, believe
+;;     it or not, things that were already of the form, 'cl-func-name'
+;;     were renamed to 'cl--func-name'.
+;;
+;;     Because CL is a hell of a lot more common (pun intended) and
+;;     widespread in Emacs Lisp code than RMS would like to believe,
+;;     this nonsensical change has rendered huge amounts of code that
+;;     will no longer run or byte-compile in (S)XEmacs.  Hence, this
+;;     compatibility lib.
+;;
+;;     Use of anything in this lib intended for (S)XEmacs only code is
+;;     a hanging offence. DO NOT DO IT!
+;;
+
+;;; Todo:
+;;
+;;     
+
+
+;;; Code:
+;; cl--
+(defvar compat-cl--funcs
+  '(cl-adjoin
+    cl-arglist-args
+    cl-check-key
+    cl-check-match
+    cl-check-test
+    cl-check-test-nokey
+    cl-compile-time-too
+    cl-compiling-file
+    cl-const-expr-p
+    cl-const-expr-val
+    cl-defsubst-expand
+    cl-delete-duplicates
+    cl-do-arglist
+    cl-do-prettyprint
+    cl-do-proclaim
+    cl-do-remf
+    cl-do-subst
+    cl-expand-do-loop
+    cl-expr-contains
+    cl-expr-contains-any
+    cl-expr-depends-p
+    cl-finite-do
+    cl-loop-build-ands
+    cl-loop-handle-accum
+    cl-loop-let
+    cl-mapcar-many
+    cl-map-intervals
+    cl-map-keymap-recursively
+    cl-map-overlays
+    cl-nsublis-rec
+    cl-parse-loop-clause
+    cl-parsing-keywords
+    cl-pop2
+    cl-position
+    cl-progv-after
+    cl-progv-before
+    cl-random-time
+    cl-safe-expr-p
+    cl-set-buffer-substring
+    cl-set-frame-visible-p
+    cl-set-getf
+    cl-set-substring
+    cl-simple-expr-p
+    cl-simple-exprs-p
+    cl-sublis-rec
+    cl-transform-lambda
+    cl-tree-equal-rec)
+  "List of CL functions that exist in FSF as 'cl--func-name'.")
+
+(mapcar
+ #'(lambda (lib)
+     (defalias
+       (intern (concat "cl--" (substring (symbol-name lib) 3)))
+       lib))
+ compat-cl--funcs)
+
+;; cl-
+(defvar compat-cl-funcs
+  '(acons
+    assert
+    assoc-if
+    assoc-if-not
+    block
+    callf
+    callf2
+    case
+    check-type
+    coerce
+    compiler-macroexpand
+    concatenate
+    count-if
+    count-if-not
+    decf
+    declaim
+    declare
+    define-compiler-macro
+    defstruct
+    defsubst
+    deftype
+    delete-if
+    delete-if-not
+    destructuring-bind
+    do
+    do-all-symbols
+    dolist
+    do-symbols
+    dotimes
+    ecase
+    eighth
+    equalp
+    etypecase
+    eval-when
+    every
+    fifth
+    fill
+    find
+    find-if
+    find-if-not
+    flet
+    flet*
+    gensym
+    gentemp
+    incf
+    intersection
+    isqrt
+    labels
+    ldiff
+    letf
+    letf*
+    list-length
+    load-time-value
+    locally
+    macrolet
+    make-random-state
+    mapc
+    mapcan
+    mapcon
+    mapl
+    maplist
+    member-if
+    member-if-not
+    merge
+    minusp
+    mismatch
+    multiple-value-bind
+    multiple-value-setq
+    nintersection
+    ninth
+    notany
+    notevery
+    nreconc
+    nset-difference
+    nset-exclusive-or
+    nsublis
+    nsubst
+    nsubst-if
+    nsubst-if-not
+    nsubstitute
+    nsubstitute-if
+    nsubstitute-if-not
+    nunion
+    pairlis
+    plusp
+    position-if
+    position-if-not
+    proclaim
+    progv
+    psetf
+    psetq
+    pushnew
+    rassoc-if
+    rassoc-if-not
+    reduce
+    remf
+    remove
+    remove-duplicates
+    remove-if
+    remove-if-not
+    replace
+    return
+    return-from
+    revappend
+    rotatef
+    search
+    set-difference
+    set-exclusive-or
+    seventh
+    shiftf
+    signum
+    sixth
+    some
+    stable-sort
+    sublis
+    subsetp
+    subst
+    subst-if
+    subst-if-not
+    substitute
+    substitute-if
+    substitute-if-not
+    symbol-macrolet
+    tailp
+    tenth
+    the
+    tree-equal
+    typecase
+    union)
+  "List of CL functions that exist in FSF as 'cl-func-name'.")
+
+(mapcar
+ #'(lambda (lib)
+     (defalias (intern (concat "cl-" (symbol-name lib)))
+       lib))
+ compat-cl-funcs)
+
+(provide 'cl-lib)
+;;; cl-lib.el ends here