Removed legacy codes for emacs-version < 25.1 (#14497)

This commit is contained in:
Lucius Hu 2021-04-28 01:04:53 -04:00 committed by GitHub
parent 982e2515a3
commit bc27203615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 47 deletions

View File

@ -2398,17 +2398,11 @@ depends on it."
(defun configuration-layer//package-delete (pkg-name)
"Delete package with name PKG-NAME."
(cond
((version<= "25.0.50" emacs-version)
(let ((p (cadr (assq pkg-name package-alist))))
;; add force flag to ignore dependency checks in Emacs25
(if (not (configuration-layer//system-package-p p))
(package-delete p t t)
(message "Would have removed package %s but this is a system package so it has not been changed." pkg-name))))
(t (let ((p (cadr (assq pkg-name package-alist))))
(if (not (configuration-layer//system-package-p p))
(package-delete p)
(message "Would have removed package %s but this is a system package so it has not been changed." pkg-name))))))
(let ((p (cadr (assq pkg-name package-alist))))
;; add force flag to ignore dependency checks in Emacs25
(if (not (configuration-layer//system-package-p p))
(package-delete p t t)
(message "Would have removed package %s but this is a system package so it has not been changed." pkg-name))))
(defun configuration-layer/delete-orphan-packages (packages)
"Delete PACKAGES if they are orphan."

View File

@ -179,8 +179,7 @@ seconds to load")
"- Editing style: %s\n"
"- Completion: %s\n"
"- Layers:\n```elisp\n%s```\n"
(when (version<= "25.1" emacs-version)
"- System configuration features: %s\n"))
"- System configuration features: %s\n")
system-type
emacs-version
spacemacs-version

View File

@ -135,9 +135,7 @@ used."
(spacemacs//micro-state-set-minibuffer-height doc)
(apply ',msg-func (list (spacemacs//micro-state-propertize-doc
(format "%S: %s" ',name doc))))))
(,(if (version< emacs-version "24.4")
'set-temporary-overlay-map
'set-transient-map)
(set-transient-map
(let ((map (make-sparse-keymap)))
,@keymap-body map) ',(spacemacs//micro-state-create-exit-func
name wrappers persistent on-exit)))

View File

@ -40,7 +40,7 @@
(org-contacts :location built-in
:toggle org-enable-org-contacts-support)
(org-vcard :toggle org-enable-org-contacts-support)
(org-brain :toggle (version<= "25" emacs-version))
org-brain
(org-expiry :location built-in)
; temporarily point org-journal to dalanicolai fork until dalanicolai's
; PR's https://github.com/bastibe/org-journal/pulls get merged
@ -221,8 +221,8 @@ Will work on both org-mode and any mode that accepts plain html."
("mtd" . "delete")
("mti" . "insert")
("mtt" . "toggle")
("mx" . "text")
))
("mx" . "text")))
(spacemacs/declare-prefix-for-mode 'org-mode (car prefix) (cdr prefix)))
(spacemacs/set-leader-keys-for-major-mode 'org-mode
"'" 'org-edit-special
@ -832,8 +832,8 @@ Headline^^ Visit entry^^ Filter^^ Da
(let ((agenda-files (org-agenda-files)))
(if agenda-files
(progn (find-file (if org-persp-startup-org-file org-persp-startup-org-file (first agenda-files)))
(if org-persp-startup-with-agenda (org-agenda nil org-persp-startup-with-agenda)
))
(if org-persp-startup-with-agenda (org-agenda nil org-persp-startup-with-agenda)))
(user-error "Error: No agenda files configured, nothing to display.")))))
(defun org/init-org-contacts ()

View File

@ -22,10 +22,8 @@
(setq typography-packages
'(
(tildify :toggle (version<= "25" emacs-version))
typo
))
'(tildify
typo))
(defun typography/init-typo ()
(use-package typo

View File

@ -89,11 +89,6 @@
(add-hook 'css-mode-hook
#'spacemacs//setup-lsp-for-web-mode-buffers t))
;; Explicitly run prog-mode hooks since css-mode does not derive from
;; prog-mode major-mode in Emacs 24 and below.
(when (version< emacs-version "25")
(add-hook 'css-mode-hook 'spacemacs/run-prog-mode-hooks))
(spacemacs/declare-prefix-for-mode 'css-mode "m=" "format")
(spacemacs/declare-prefix-for-mode 'css-mode "mg" "goto")
(spacemacs/declare-prefix-for-mode 'css-mode "mz" "foldz")

View File

@ -114,10 +114,6 @@
(when python-spacemacs-indent-guess
(python-indent-guess-indent-offset))
(when (version< emacs-version "24.5")
;; auto-indent on colon doesn't work well with if statement
;; should be fixed in 24.5 and above
(setq electric-indent-chars (delq ?: electric-indent-chars)))
(setq-local comment-inline-offset 2)
(spacemacs/python-annotate-pdb)
;; make C-j work the same way as RET
@ -522,11 +518,6 @@ Bind formatter to '==' for LSP and '='for all other backends."
(end-of-buffer)
(evil-insert-state))
;; fix for issue #2569 (https://github.com/syl20bnr/spacemacs/issues/2569)
(when (version< emacs-version "25")
(advice-add 'wisent-python-default-setup :after
#'spacemacs//python-imenu-create-index-use-semantic-maybe))
(defun spacemacs//bind-python-repl-keys ()
"Bind the keys for testing in Python."
(spacemacs/declare-prefix-for-mode 'inferior-python-mode "mv" "virtualenv")

View File

@ -24,7 +24,6 @@
(setq spacemacs-editing-packages
'(aggressive-indent
avy
(bracketed-paste :toggle (version<= emacs-version "25.0.92"))
(clean-aindent-mode :toggle dotspacemacs-use-clean-aindent-mode)
dired-quick-sort
drag-stuff
@ -101,13 +100,6 @@
(spacemacs/avy-goto-url)
(browse-url-at-point))))))
(defun spacemacs-editing/init-bracketed-paste ()
(use-package bracketed-paste
:defer t
:init
;; Enable bracketed-paste for tty
(add-hook 'tty-setup-hook 'bracketed-paste-enable)))
(defun spacemacs-editing/init-clean-aindent-mode ()
(use-package clean-aindent-mode
:config