Skip to content

Commit

Permalink
💣 Drop support for Emacs 24.3
Browse files Browse the repository at this point in the history
Spacemacs now needs at least 24.4 to launch.
  • Loading branch information
syl20bnr committed Jun 21, 2016
1 parent 41af5fd commit 31bab70
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 1,913 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand All @@ -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

Expand Down
49 changes: 8 additions & 41 deletions core/core-configuration-layer.el
Original file line number Diff line number Diff line change
Expand Up @@ -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'."
Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -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))
Expand All @@ -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."
Expand All @@ -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."
Expand All @@ -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
Expand Down
35 changes: 1 addition & 34 deletions core/core-emacs-backports.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 0 additions & 2 deletions doc/LAYERS.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -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. "
Expand Down
5 changes: 1 addition & 4 deletions layers/+completion/auto-completion/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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 ()
Expand Down
3 changes: 1 addition & 2 deletions layers/+distributions/spacemacs-base/keybindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand Down
103 changes: 0 additions & 103 deletions layers/+spacemacs/spacemacs-ui/local/paradox/README.md

This file was deleted.

Loading

0 comments on commit 31bab70

Please sign in to comment.