💣 Drop support for Emacs 24.3

Spacemacs now needs at least 24.4 to launch.
This commit is contained in:
syl20bnr 2016-06-20 21:50:30 -04:00
parent 41af5fd9d7
commit 31bab70397
11 changed files with 17 additions and 1913 deletions

View File

@ -115,8 +115,7 @@ If you prefer IRC, connect to the [Gitter Chat IRC server][] and join the
## Emacs
Spacemacs is operational with Emacs 24.3, but Emacs 24.4 and above are highly
recommended to enjoy a full experience. The next Emacs major release, Emacs 25,
Spacemacs requires Emacs 24.4 or above. The next Emacs major release, Emacs 25,
is not *officially* supported but is partially working (i.e. bugs should be
expected).
@ -132,9 +131,9 @@ XEmacs is an old fork of Emacs. The X in its name is unrelated to X11.
Both Emacs and XEmacs have graphical support.
**Note:** Ubuntu LTS 12.04 and 14.04 repositories have only Emacs 24.3
available. You are advised to [build from source][build_source] Emacs 24.4 or
greater, as most packages require this version. The same may be true for other
distributions as well.
available. You have to [build from source][build_source] Emacs 24.4 or greater,
as Spacemacs won't work with 24.3. The same may be true for other distributions
as well.
### OS X

View File

@ -240,14 +240,7 @@ cache folder.")
configuration-layer--elpa-archives))
;; optimization, no need to activate all the packages so early
(setq package-enable-at-startup nil)
(package-initialize 'noactivate)
;; TODO remove the following hack when 24.3 support ends
;; Emacs 24.3 and above ships with python.el but in some Emacs 24.3.1
;; packages for Ubuntu, python.el seems to be missing.
;; This hack adds marmalade repository for this case only.
(unless (or (package-installed-p 'python) (version< emacs-version "24.3"))
(add-to-list 'package-archives
'("marmalade" . "https://marmalade-repo.org/packages/")))))
(package-initialize 'noactivate)))
(defun configuration-layer//install-quelpa ()
"Install `quelpa'."
@ -1579,11 +1572,8 @@ to select one."
(defun configuration-layer//activate-package (pkg)
"Activate PKG."
(if (version< emacs-version "24.3.50")
;; fake version list to always activate the package
(package-activate pkg '(0 0 0 0))
(unless (memq pkg package-activated-list)
(package-activate pkg))))
(unless (memq pkg package-activated-list)
(package-activate pkg)))
(defun configuration-layer/get-layers-list ()
"Return a list of all discovered layer symbols."
@ -1651,31 +1641,17 @@ to select one."
(defun configuration-layer//get-package-directory (pkg-name)
"Return the directory path for package with name PKG-NAME."
(let ((pkg-desc (assq pkg-name package-alist)))
(cond
((version< emacs-version "24.3.50")
(let* ((version (aref (cdr pkg-desc) 0))
(elpa-dir (file-name-as-directory package-user-dir))
(pkg-dir-name (format "%s-%s.%s"
(symbol-name pkg-name)
(car version)
(cadr version))))
(expand-file-name (concat elpa-dir pkg-dir-name))))
(t (package-desc-dir (cadr pkg-desc))))))
(package-desc-dir (cadr pkg-desc))))
(defun configuration-layer//get-package-deps-from-alist (pkg-name)
"Return the dependencies alist for package with name PKG-NAME."
(let ((pkg-desc (assq pkg-name package-alist)))
(when pkg-desc
(cond
((version< emacs-version "24.3.50") (aref (cdr pkg-desc) 1))
(t (package-desc-reqs (cadr pkg-desc)))))))
(when pkg-desc (package-desc-reqs (cadr pkg-desc)))))
(defun configuration-layer//get-package-deps-from-archive (pkg-name)
"Return the dependencies alist for a PKG-NAME from the archive data."
(let* ((pkg-arch (assq pkg-name package-archive-contents))
(reqs (when pkg-arch (if (version< emacs-version "24.3.50")
(aref (cdr pkg-arch) 1)
(package-desc-reqs (cadr pkg-arch))))))
(reqs (when pkg-arch (package-desc-reqs (cadr pkg-arch)))))
;; recursively get the requirements of reqs
(dolist (req reqs)
(let* ((pkg-name2 (car req))
@ -1688,10 +1664,7 @@ to select one."
"Return the version string for package with name PKG-NAME."
(let ((pkg-desc (assq pkg-name package-alist)))
(when pkg-desc
(cond
((version< emacs-version "24.3.50") (package-version-join
(aref (cdr pkg-desc) 0)))
(t (package-version-join (package-desc-version (cadr pkg-desc))))))))
(package-version-join (package-desc-version (cadr pkg-desc))))))
(defun configuration-layer//get-package-version (pkg-name)
"Return the version list for package with name PKG-NAME."
@ -1704,10 +1677,7 @@ to select one."
"Return the version string for package with name PKG-NAME."
(let ((pkg-arch (assq pkg-name package-archive-contents)))
(when pkg-arch
(cond
((version< emacs-version "24.3.50") (package-version-join
(aref (cdr pkg-arch) 0)))
(t (package-version-join (package-desc-version (cadr pkg-arch))))))))
(package-version-join (package-desc-version (cadr pkg-arch))))))
(defun configuration-layer//get-latest-package-version (pkg-name)
"Return the versio list for package with name PKG-NAME."
@ -1719,9 +1689,6 @@ to select one."
(defun configuration-layer//package-delete (pkg-name)
"Delete package with name PKG-NAME."
(cond
((version< emacs-version "24.3.50")
(let ((v (configuration-layer//get-package-version-string pkg-name)))
(when v (package-delete (symbol-name pkg-name) v))))
((version<= "25.0.50" emacs-version)
(let ((p (cadr (assq pkg-name package-alist))))
;; add force flag to ignore dependency checks in Emacs25

View File

@ -9,39 +9,6 @@
;;
;;; License: GPLv3
(unless (featurep 'subr-x)
;; `subr-x' function for Emacs 24.3 and below
(defsubst string-join (strings &optional separator)
"Join all STRINGS using SEPARATOR."
(mapconcat 'identity strings separator))
(defsubst string-trim-left (string)
"Remove leading whitespace from STRING."
(if (string-match "\\`[ \t\n\r]+" string)
(replace-match "" t t string)
string))
(defsubst string-trim-right (string)
"Remove trailing whitespace from STRING."
(if (string-match "[ \t\n\r]+\\'" string)
(replace-match "" t t string)
string))
(defsubst string-trim (string)
"Remove leading and trailing whitespace from STRING."
(string-trim-left (string-trim-right string)))
(defsubst string-empty-p (string)
"Check whether STRING is empty."
(string= string "")))
(unless (fboundp 'with-eval-after-load)
;; `with-eval-after-load' function for Emacs 24.3 and below
(defmacro with-eval-after-load (file &rest body)
"Execute BODY after FILE is loaded.
FILE is normally a feature name, but it can also be a file name,
in case that file does not provide any feature."
(declare (indent 1) (debug t))
`(eval-after-load ,file (lambda () ,@body))))
;; nothing for now
(provide 'core-emacs-backports)

View File

@ -213,8 +213,6 @@ executed immediately.
Since =with-eval-after-load= is a macro and not a function, its argument does
not have to be quoted.
**Note**: =with-eval-after-load= is backported for those still on Emacs 24.3
** Use-package
For /end users/ who are trying to put together an efficient Emacs configuration,
there is a very useful /package/ called =use-package= that provides a macro

View File

@ -16,7 +16,7 @@
(setq gc-cons-threshold 100000000)
(defconst spacemacs-version "0.105.21" "Spacemacs version.")
(defconst spacemacs-emacs-min-version "24.3" "Minimal version of Emacs.")
(defconst spacemacs-emacs-min-version "24.4" "Minimal version of Emacs.")
(if (not (version<= spacemacs-emacs-min-version emacs-version))
(message (concat "Your version of Emacs (%s) is too old. "

View File

@ -14,6 +14,7 @@
auto-complete
ac-ispell
company
company-quickhelp
company-statistics
(helm-company :toggle (configuration-layer/package-usedp 'helm))
(helm-c-yasnippet :toggle (configuration-layer/package-usedp 'helm))
@ -23,10 +24,6 @@
smartparens
))
;; company-quickhelp from MELPA is not compatible with 24.3 anymore
(unless (version< emacs-version "24.4")
(push 'company-quickhelp auto-completion-packages))
;; TODO replace by company-ispell which comes with company
;; to be moved to spell-checking layer as well
(defun auto-completion/init-ac-ispell ()

View File

@ -296,7 +296,6 @@
:documentation "Display the current frame in full screen."
:evil-leader "TF")
(spacemacs|add-toggle maximize-frame
:if (version< "24.3.50" emacs-version)
:status (eq (frame-parameter nil 'fullscreen) 'maximized)
:on (toggle-frame-maximized)
:off (toggle-frame-maximized)
@ -319,7 +318,7 @@
:documentation "Display the tool bar in GUI mode."
:evil-leader "Tt")
(spacemacs|add-toggle menu-bar
:if (or window-system (version<= "24.3.1" emacs-version))
:if window-system
:mode menu-bar-mode
:documentation "Display the menu bar."
:evil-leader "Tm")

View File

@ -1,103 +0,0 @@
Paradox
=======
Project for modernizing Emacs' Package Menu. With package ratings,
usage statistics, customizability, and more.
Here are some visual comparisons:
#### Regular Package Menu ####
![Regular Package Menu](https://raw.github.com/Bruce-Connor/paradox/master/before.png)
#### Paradox ####
![Paradox Package Menu](https://raw.github.com/Bruce-Connor/paradox/master/after.png)
#### Paradox (multi-line) ####
![Paradox Package Menu](https://raw.github.com/Bruce-Connor/paradox/master/multi-line.png)
*These screenshots use smart-mode-line, but a similar effect is obtained with the regular mode-line.*
Usage
===
Paradox can be installed from Melpa with `M-x package-install RET
paradox`.
It can also be installed manually in the usual way, just be mindful of
the dependencies.
To use it, simply call `M-x paradox-list-packages` (instead of the
regular `list-packages`).
This will give you most features out of the box. If you want to be
able to star packages as well, just configure the
`paradox-github-token` variable then call `paradox-list-packages`
again.
If you'd like to stop using Paradox, you may call `paradox-disable`
and go back to using the regular `list-packages`.
## Current Features ##
### Several Improvements ###
Paradox implements many small improvements to the package menu
itself. They all work out of the box and are completely customizable!
*(Also, hit `h` to see all keys.)*
* Visit the package's homepage with `v` (or just use the provided buttons).
* View a list of recent commits with `l`.
* Use `paradox-require` instead of `require` to automatically install
absent packages.
* Shortcuts for package filtering:
* `f r` filters by regexp (`occur`);
* `f u` display only packages with upgrades;
* `f k` filters by keyword (emacs 24.4 only).
And some more...
* `hl-line-mode` enabled by default.
* Display useful information on the mode-line and cleanup a bunch of
useless stuff.
* **Customization!** Just call `M-x paradox-customize` to see what you can
do.
* Customize column widths.
* Customize faces (`paradox-star-face`,
`paradox-status-face-alist` and `paradox-archive-face`).
* Customize local variables.
### Package Ratings ###
Paradox also integrates with
**GitHub Stars**, which works as **rough** package rating system.
That is, Paradox package menu will:
1. Display the number of GitHub Stars each package has (assuming it's
in a github repo, of course);
2. Possibly automatically star packages you install, and unstar
packages you delete (you will be asked the first time whether you
want this);
3. Let you star and unstar packages by hitting the `s` key;
4. Let you star all packages you have installed with `M-x paradox-star-all-installed-packages`.
Item **1.** will work out of the box, the other items obviously
require a github account (Paradox will help you generate a token the
first time you call `paradox-list-packages`).
## Known Bugs ##
* On some cases there's an annoying gnutls error message after downloading the star counts `gnutls.c: [0] (Emacs) fatal error: The TLS connection was non-properly terminated.`.
If anyone knows how to fix it, I'm all ears.
## How Star Displaying Works ##
We generate a map of `Package Name -> Repository` from
[Melpa](https://github.com/milkypostman/melpa.git)'s `recipe`
directory, some repos may correspond to more than one package.
This map is used count the stars a given package has.
_This doesn't mean you need Melpa to see the star counts, the numbers
will be displayed regardless of what archives you use._
Currently, packages that are not hosted on GitHub are listed with a
blank star count, which is clearly different from 0-star packages
(which are displayed with a 0, obviously).
If you know of an alternative that could be used for these packages,
[open an issue](https://github.com/Bruce-Connor/paradox/issues/new)
here, I'd love to hear.

View File

@ -1,212 +0,0 @@
;;; paradox-compat.el --- Compatibility functions for using paradox with emacs < 24.4
;; Copyright (C) 2014 Artur Malabarba <bruce.connor.am@gmail.com>
;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
;; URL: https://github.com/Bruce-Connor/paradox
;; Version: 1.0.1
;; Keywords: package packages mode-line
;; Package-Requires: ((emacs "24.1") (tabulated-list "1.0") (package "1.0") (json "1.4"))
;; Prefix: paradox
;; Separator: -
;;; License:
;;
;; This file is NOT part of GNU Emacs.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 2
;; of the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;;; Code:
(eval-when-compile (require 'package))
;; (require 'json)
;; (require 'cl)
(defun paradox--print-info-compat (pkg)
"Return a package entry suitable for `tabulated-list-entries' (package-1.0 version).
PKG has the form ((PACKAGE . VERSION) STATUS DOC).
Return (KEY [NAME VERSION STATUS DOC]), where KEY is the
identifier (NAME . VERSION-LIST)."
(let* ((package (caar pkg))
(version (cdr (car pkg)))
(status (nth 1 pkg))
(doc (or (nth 2 pkg) ""))
(face (or (cdr (assoc-string status paradox-status-face-alist))
'font-lock-warning-face))
(url (paradox--package-homepage package))
(name (symbol-name package))
(name-length (length name))
(button-length (length paradox-homepage-button-string)))
(paradox--incf status)
(list (cons package version)
(vconcat
(append (list (concat
(propertize name
'face 'paradox-name-face
'button t
'follow-link t
'package-symbol package
'help-echo (format "Package: %s" name)
'action 'package-menu-describe-package)
(if (and paradox-use-homepage-buttons url
(< (+ name-length button-length) paradox-column-width-package))
(concat
(make-string (- paradox-column-width-package name-length button-length) ?\s)
(propertize paradox-homepage-button-string
'face 'paradox-homepage-button-face
'mouse-face 'custom-button-mouse
'help-echo (format "Visit %s" url)
'button t
'follow-link t
'action 'paradox-menu-visit-homepage))
""))
(propertize (package-version-join version)
'font-lock-face face)
(propertize status 'font-lock-face face))
(paradox--count-print package)
(list
(propertize (concat desc-prefix doc desc-suffix)
'font-lock-face
(if (> paradox-lines-per-entry 1)
'paradox-description-face-multiline
'paradox-description-face))))))))
(defun paradox--print-entry-compat (id cols)
"Printer used by `paradox-menu-mode'.
Just like default printer, except columns are printed with
`paradox--print-col-compat'."
(let ((beg (point))
(x (max tabulated-list-padding 0))
(ncols (length tabulated-list-format))
(inhibit-read-only t))
(if (> tabulated-list-padding 0)
(insert (make-string x ?\s)))
(dotimes (n ncols)
(setq x (paradox--print-col-compat n (aref cols n) x)))
(insert ?\n)
(put-text-property beg (point) 'tabulated-list-id id)
(put-text-property beg (point) 'tabulated-list-entry cols)))
(defun paradox--print-col-compat (n col-desc x)
"Insert a specified Tabulated List entry at point.
N is the column number, COL-DESC is a column descriptor \(see
`tabulated-list-entries'), and X is the column number at point.
Return the column number after insertion.
This is like `tabulated-list-print-col', except the help-echo
property is respected."
;; TODO: don't truncate to `width' if the next column is align-right
;; and has some space left.
(let* ((format (aref tabulated-list-format n))
(name (nth 0 format))
(width (nth 1 format))
(props (nthcdr 3 format))
(pad-right (or (plist-get props :pad-right) 1))
(right-align (plist-get props :right-align))
(label (if (stringp col-desc) col-desc (car col-desc)))
(label-width (string-width label))
(help-echo (concat (car format) ": " label))
(opoint (point))
(not-last-col (< (1+ n) (length tabulated-list-format))))
;; Truncate labels if necessary (except last column).
(and not-last-col
(> label-width width)
(setq label (truncate-string-to-width label width nil nil t)
label-width width))
(setq label (bidi-string-mark-left-to-right label))
(when (and right-align (> width label-width))
(let ((shift (- width label-width)))
(insert (propertize (make-string shift ?\s)
'display `(space :align-to ,(+ x shift))))
(setq width (- width shift))
(setq x (+ x shift))))
(if (stringp col-desc)
(insert (if (get-text-property 0 'help-echo label)
label
(propertize label 'help-echo help-echo)))
(apply 'insert-text-button label (cdr col-desc)))
(let ((next-x (+ x pad-right width)))
;; No need to append any spaces if this is the last column.
(when not-last-col
(when (> pad-right 0) (insert (make-string pad-right ?\s)))
(insert (propertize
(make-string (- next-x x label-width pad-right) ?\s)
'display `(space :align-to ,next-x))))
(put-text-property opoint (point) 'tabulated-list-column-name name)
next-x)))
(defun paradox--package-homepage (pkg)
"PKG is just the symbol that identifies the package."
(let ((extras (elt (cdr-safe (assoc pkg package-archive-contents)) 4)))
(and (listp extras) (cdr-safe (assoc :url extras)))))
(defmacro package--push-compat (package desc status listname)
"Convenience macro for `package-menu--generate'.
If the alist stored in the symbol LISTNAME lacks an entry for a
package PACKAGE with descriptor DESC, add one. The alist is
keyed with cons cells (PACKAGE . VERSION-LIST), where PACKAGE is
a symbol and VERSION-LIST is a version list."
`(let* ((version (package-desc-vers ,desc))
(key (cons ,package version)))
(unless (assoc key ,listname)
(push (list key ,status (package-desc-doc ,desc)) ,listname))))
(defun paradox-menu--refresh (packages &optional keywords)
;; Construct list of ((PACKAGE . VERSION) STATUS DESCRIPTION).
(let (info-list name)
;; Installed packages:
(dolist (elt package-alist)
(setq name (car elt))
(when (or (eq packages t) (memq name packages))
(package--push-compat name (cdr elt)
(if (stringp (cadr (assq name package-load-list)))
"held" "installed")
info-list)))
;; Built-in packages:
(dolist (elt package--builtins)
(setq name (car elt))
(when (and (not (eq name 'emacs)) ; Hide the `emacs' package.
(or (eq packages t) (memq name packages)))
(package--push-compat name (cdr elt) "built-in" info-list)))
;; Available and disabled packages:
(dolist (elt package-archive-contents)
(setq name (car elt))
(when (or (eq packages t) (memq name packages))
(let ((hold (assq name package-load-list)))
(package--push-compat name (cdr elt)
(cond
((and hold (null (cadr hold))) "disabled")
((memq name package-menu--new-package-list) "new")
(t "available"))
info-list))))
;; Obsolete packages:
(dolist (elt package-obsolete-alist)
(dolist (inner-elt (cdr elt))
(when (or (eq packages t) (memq (car elt) packages))
(package--push-compat (car elt) (cdr inner-elt) "obsolete" info-list))))
;; Print the result.
(setq tabulated-list-entries (mapcar 'package-menu--print-info info-list))
(tabulated-list-print remember-pos)))
(defun paradox--get-or-return-package (pkg)
(if (or (markerp pkg) (null pkg))
(if (derived-mode-p 'package-menu-mode)
(car (tabulated-list-get-id))
(error "Not in Package Menu."))
pkg))
(provide 'paradox-compat)
;;; paradox-compat.el ends here.

File diff suppressed because it is too large Load Diff

View File

@ -19,15 +19,10 @@
flx-ido
info+
open-junk-file
paradox
restart-emacs
window-numbering))
;; Paradox from MELPA is not compatible with 24.3, so we use
;; a local paradox with 24.3
(if (version< emacs-version "24.4")
(push '(paradox :location local) spacemacs-ui-packages)
(push 'paradox spacemacs-ui-packages))
;; Initialization of packages
(defun spacemacs-ui/init-ace-link ()